diff options
Diffstat (limited to 'client/src')
6 files changed, 13 insertions, 7 deletions
diff --git a/client/src/app/admin/users/shared/user.service.ts b/client/src/app/admin/users/shared/user.service.ts index d96db4575..13be553c0 100644 --- a/client/src/app/admin/users/shared/user.service.ts +++ b/client/src/app/admin/users/shared/user.service.ts | |||
@@ -20,7 +20,7 @@ export class UserService { | |||
20 | 20 | ||
21 | return this.authHttp.post(UserService.BASE_USERS_URL, body) | 21 | return this.authHttp.post(UserService.BASE_USERS_URL, body) |
22 | .map(this.restExtractor.extractDataBool) | 22 | .map(this.restExtractor.extractDataBool) |
23 | .catch((res) => this.restExtractor.handleError(res)); | 23 | .catch(this.restExtractor.handleError); |
24 | } | 24 | } |
25 | 25 | ||
26 | getUsers() { | 26 | getUsers() { |
diff --git a/client/src/app/admin/users/user-add/user-add.component.ts b/client/src/app/admin/users/user-add/user-add.component.ts index b7efd3a80..8dd98cc5c 100644 --- a/client/src/app/admin/users/user-add/user-add.component.ts +++ b/client/src/app/admin/users/user-add/user-add.component.ts | |||
@@ -31,7 +31,7 @@ export class UserAddComponent implements OnInit { | |||
31 | this.userService.addUser(this.username, this.password).subscribe( | 31 | this.userService.addUser(this.username, this.password).subscribe( |
32 | ok => this.router.navigate([ '/admin/users/list' ]), | 32 | ok => this.router.navigate([ '/admin/users/list' ]), |
33 | 33 | ||
34 | err => this.error = err | 34 | err => this.error = err.text |
35 | ); | 35 | ); |
36 | } | 36 | } |
37 | } | 37 | } |
diff --git a/client/src/app/admin/users/user-list/user-list.component.ts b/client/src/app/admin/users/user-list/user-list.component.ts index 598daa42a..c89a61bca 100644 --- a/client/src/app/admin/users/user-list/user-list.component.ts +++ b/client/src/app/admin/users/user-list/user-list.component.ts | |||
@@ -27,7 +27,7 @@ export class UserListComponent implements OnInit { | |||
27 | this.totalUsers = totalUsers; | 27 | this.totalUsers = totalUsers; |
28 | }, | 28 | }, |
29 | 29 | ||
30 | err => alert(err) | 30 | err => alert(err.text) |
31 | ); | 31 | ); |
32 | } | 32 | } |
33 | 33 | ||
@@ -37,7 +37,7 @@ export class UserListComponent implements OnInit { | |||
37 | this.userService.removeUser(user).subscribe( | 37 | this.userService.removeUser(user).subscribe( |
38 | () => this.getUsers(), | 38 | () => this.getUsers(), |
39 | 39 | ||
40 | err => alert(err) | 40 | err => alert(err.text) |
41 | ); | 41 | ); |
42 | } | 42 | } |
43 | } | 43 | } |
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 | } |
diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index 1324a6214..9a9ffe29f 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts | |||
@@ -98,7 +98,7 @@ export class VideoListComponent implements OnInit, OnDestroy { | |||
98 | 98 | ||
99 | this.loading.next(false); | 99 | this.loading.next(false); |
100 | }, | 100 | }, |
101 | error => alert(error) | 101 | error => alert(error.text) |
102 | ); | 102 | ); |
103 | } | 103 | } |
104 | 104 | ||
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index bc0e3157d..d260e55c7 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts | |||
@@ -86,7 +86,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
86 | this.video = video; | 86 | this.video = video; |
87 | this.loadVideo(); | 87 | this.loadVideo(); |
88 | }, | 88 | }, |
89 | error => alert(error) | 89 | error => alert(error.text) |
90 | ); | 90 | ); |
91 | }); | 91 | }); |
92 | } | 92 | } |