aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-14 17:06:31 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-14 17:25:36 +0200
commitbfb3a98fac582f104c6d9b8b7242ea2cbb650b91 (patch)
tree24ead7cbbdc785315c406dfba85a55fe5e235d09 /client/src/app/shared/rest
parentd5050d1e097e761685fbaafe6e3d4b8b78d48356 (diff)
downloadPeerTube-bfb3a98fac582f104c6d9b8b7242ea2cbb650b91.tar.gz
PeerTube-bfb3a98fac582f104c6d9b8b7242ea2cbb650b91.tar.zst
PeerTube-bfb3a98fac582f104c6d9b8b7242ea2cbb650b91.zip
Remove ng2 file upload module
Unmaintained and we don't need it anymore with httpclient
Diffstat (limited to 'client/src/app/shared/rest')
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts18
1 files changed, 14 insertions, 4 deletions
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts
index 32dad5c73..1f6222da8 100644
--- a/client/src/app/shared/rest/rest-extractor.service.ts
+++ b/client/src/app/shared/rest/rest-extractor.service.ts
@@ -40,19 +40,29 @@ export class RestExtractor {
40 handleError (err: HttpErrorResponse) { 40 handleError (err: HttpErrorResponse) {
41 let errorMessage 41 let errorMessage
42 42
43 console.log(err)
44
43 if (err.error instanceof Error) { 45 if (err.error instanceof Error) {
44 // A client-side or network error occurred. Handle it accordingly. 46 // A client-side or network error occurred. Handle it accordingly.
45 errorMessage = err.error.message 47 errorMessage = err.error.message
46 console.error('An error occurred:', errorMessage) 48 console.error('An error occurred:', errorMessage)
47 } else if (err.status !== undefined) { 49 } else if (err.status !== undefined) {
48 // The backend returned an unsuccessful response code. 50 const body = err.error
49 // The response body may contain clues as to what went wrong, 51 errorMessage = body.error
50 errorMessage = err.error
51 console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`) 52 console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`)
52 } else { 53 } else {
53 errorMessage = err 54 errorMessage = err
54 } 55 }
55 56
56 return Observable.throw(errorMessage) 57 const errorObj = {
58 message: errorMessage,
59 status: undefined
60 }
61
62 if (err.status) {
63 errorObj.status = err.status
64 }
65
66 return Observable.throw(errorObj)
57 } 67 }
58} 68}