diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/rest/rest-extractor.service.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts index aa44799af..fcb1598f4 100644 --- a/client/src/app/shared/rest/rest-extractor.service.ts +++ b/client/src/app/shared/rest/rest-extractor.service.ts | |||
@@ -34,13 +34,19 @@ export class RestExtractor { | |||
34 | handleError(res: Response) { | 34 | handleError(res: Response) { |
35 | let text = 'Server error: '; | 35 | let text = 'Server error: '; |
36 | text += res.text(); | 36 | text += res.text(); |
37 | let json = res.json(); | 37 | let json = ''; |
38 | |||
39 | try { | ||
40 | json = res.json(); | ||
41 | } catch (err) { ; } | ||
38 | 42 | ||
39 | const error = { | 43 | const error = { |
40 | json, | 44 | json, |
41 | text | 45 | text |
42 | }; | 46 | }; |
43 | 47 | ||
48 | console.error(error); | ||
49 | |||
44 | return Observable.throw(error); | 50 | return Observable.throw(error); |
45 | } | 51 | } |
46 | } | 52 | } |