diff --git a/src/services/HttpService.ts b/src/services/HttpService.ts index f466ae5..0acde11 100644 --- a/src/services/HttpService.ts +++ b/src/services/HttpService.ts @@ -79,10 +79,16 @@ const makeCallToBackend = ({ .then((result: any) => { if (isSuccessful) { successCallback(result); - } else if (failureCallback) { - failureCallback(result.message); } 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) => {