diff --git a/src/services/http.service.ts b/src/services/http.service.ts index 00865df..12d588e 100644 --- a/src/services/http.service.ts +++ b/src/services/http.service.ts @@ -106,11 +106,11 @@ class HttpService { errorMessage = dataAtPath; } } - } catch {} + } catch {} // TODO: proper handling of errors (^.^) - errorMessage = `${res.status} - ${res.statusText || ''}`; - - return errorMessage; + return errorMessage && errorMessage.length ? + errorMessage : + `${res.status} - ${res.statusText || ''}`; } private async handleError(res: Response) { @@ -149,4 +149,4 @@ class HttpService { } } -export default HttpService; \ No newline at end of file +export default HttpService;