aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-23 17:42:56 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-23 17:42:56 +0200
commitbf68dd752d6e3d5fce791dd8e0df9debb9d96902 (patch)
tree867e4bef8481b85e81193342922ec60430029838 /client/src/app/shared/rest
parentde59c48f5f317018e3f746bbe4a7b7efe00109f2 (diff)
downloadPeerTube-bf68dd752d6e3d5fce791dd8e0df9debb9d96902.tar.gz
PeerTube-bf68dd752d6e3d5fce791dd8e0df9debb9d96902.tar.zst
PeerTube-bf68dd752d6e3d5fce791dd8e0df9debb9d96902.zip
Client: fix error display for component
Diffstat (limited to 'client/src/app/shared/rest')
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts8
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}