diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-07 18:40:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-07 18:41:10 +0200 |
commit | 47f8de28346a7aa28425265f316dc26bf2376c45 (patch) | |
tree | d249ee979f3488f92a2917e7b3b016db08aca8db /client/src/app/shared | |
parent | fd5e57bbe2accbdb16b6aa65337c5ef44b5bd8fb (diff) | |
download | PeerTube-47f8de28346a7aa28425265f316dc26bf2376c45.tar.gz PeerTube-47f8de28346a7aa28425265f316dc26bf2376c45.tar.zst PeerTube-47f8de28346a7aa28425265f316dc26bf2376c45.zip |
Fix error message on token expiration
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/rest/rest-extractor.service.ts | 4 |
1 files changed, 3 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 b1e22a76c..8ed24c727 100644 --- a/client/src/app/shared/rest/rest-extractor.service.ts +++ b/client/src/app/shared/rest/rest-extractor.service.ts | |||
@@ -33,13 +33,15 @@ export class RestExtractor { | |||
33 | return target | 33 | return target |
34 | } | 34 | } |
35 | 35 | ||
36 | handleError (err: HttpErrorResponse) { | 36 | handleError (err: any) { |
37 | let errorMessage | 37 | let errorMessage |
38 | 38 | ||
39 | if (err.error instanceof Error) { | 39 | if (err.error instanceof Error) { |
40 | // A client-side or network error occurred. Handle it accordingly. | 40 | // A client-side or network error occurred. Handle it accordingly. |
41 | errorMessage = err.error.message | 41 | errorMessage = err.error.message |
42 | console.error('An error occurred:', errorMessage) | 42 | console.error('An error occurred:', errorMessage) |
43 | } else if (typeof err.error === 'string') { | ||
44 | errorMessage = err.error | ||
43 | } else if (err.status !== undefined) { | 45 | } else if (err.status !== undefined) { |
44 | // A server-side error occurred. | 46 | // A server-side error occurred. |
45 | if (err.error && err.error.errors) { | 47 | if (err.error && err.error.errors) { |