aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts
index 1f6222da8..62c600d25 100644
--- a/client/src/app/shared/rest/rest-extractor.service.ts
+++ b/client/src/app/shared/rest/rest-extractor.service.ts
@@ -40,15 +40,13 @@ export class RestExtractor {
40 handleError (err: HttpErrorResponse) { 40 handleError (err: HttpErrorResponse) {
41 let errorMessage 41 let errorMessage
42 42
43 console.log(err)
44
45 if (err.error instanceof Error) { 43 if (err.error instanceof Error) {
46 // A client-side or network error occurred. Handle it accordingly. 44 // A client-side or network error occurred. Handle it accordingly.
47 errorMessage = err.error.message 45 errorMessage = err.error.message
48 console.error('An error occurred:', errorMessage) 46 console.error('An error occurred:', errorMessage)
49 } else if (err.status !== undefined) { 47 } else if (err.status !== undefined) {
50 const body = err.error 48 const body = err.error
51 errorMessage = body.error 49 errorMessage = body ? body.error : 'Unknown error.'
52 console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`) 50 console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`)
53 } else { 51 } else {
54 errorMessage = err 52 errorMessage = err