print standard message if one cannot be found in the result w/ burnettk cullerton

This commit is contained in:
jasquat 2022-08-19 10:50:21 -04:00
parent 9188dbdaf5
commit 3f01a75389
1 changed files with 9 additions and 3 deletions

View File

@ -79,10 +79,16 @@ const makeCallToBackend = ({
.then((result: any) => { .then((result: any) => {
if (isSuccessful) { if (isSuccessful) {
successCallback(result); successCallback(result);
} else if (failureCallback) {
failureCallback(result.message);
} else { } else {
console.log(result.message); let message = 'A server error occurred.';
if (result.message) {
message = result.message;
}
if (failureCallback) {
failureCallback(message);
} else {
console.log(message);
}
} }
}) })
.catch((error) => { .catch((error) => {