| 1 |
- {"ast":null,"code":"import { __decorate } from \"tslib\";\nimport { Injectable } from '@angular/core';\nimport { throwError } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\nlet ErrorInterceptor = class ErrorInterceptor {\n constructor() {}\n intercept(request, next) {\n return next.handle(request).pipe(catchError(err => {\n if ([401, 403].indexOf(err.status) !== -1) {\n // this.authenticationService.logout();\n // location.reload(true);\n }\n const error = err.error.message || err.statusText;\n return throwError(error);\n }));\n }\n static #_ = this.ctorParameters = () => [];\n};\nErrorInterceptor = __decorate([Injectable()], ErrorInterceptor);\nexport { ErrorInterceptor };","map":{"version":3,"names":["Injectable","throwError","catchError","ErrorInterceptor","constructor","intercept","request","next","handle","pipe","err","indexOf","status","error","message","statusText","_","__decorate"],"sources":["C:\\FatboarProject\\angular-client\\src\\app\\interceptors\\error.interceptor.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport {\r\n HttpRequest,\r\n HttpHandler,\r\n HttpEvent,\r\n HttpInterceptor\r\n} from '@angular/common/http';\r\nimport { Observable, throwError } from 'rxjs';\r\nimport { catchError } from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class ErrorInterceptor implements HttpInterceptor {\r\n\r\n constructor() {}\r\n\r\n intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\r\n return next.handle(request).pipe(catchError(err => {\r\n if ([401, 403].indexOf(err.status) !== -1){\r\n // this.authenticationService.logout();\r\n // location.reload(true);\r\n \r\n } \r\n const error = err.error.message || err.statusText;\r\n return throwError(error);\r\n }));\r\n }\r\n}\r\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,eAAe;AAO1C,SAAqBC,UAAU,QAAS,MAAM;AAC9C,SAASC,UAAU,QAAQ,gBAAgB;AAGpC,IAAMC,gBAAgB,GAAtB,MAAMA,gBAAgB;EAE3BC,YAAA,GAAe;EAEfC,SAASA,CAACC,OAA6B,EAAEC,IAAiB;IACxD,OAAOA,IAAI,CAACC,MAAM,CAACF,OAAO,CAAC,CAACG,IAAI,CAACP,UAAU,CAACQ,GAAG,IAAG;MAChD,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACC,OAAO,CAACD,GAAG,CAACE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAC;QACxC;QACA;MAAA;MAGF,MAAMC,KAAK,GAAGH,GAAG,CAACG,KAAK,CAACC,OAAO,IAAIJ,GAAG,CAACK,UAAU;MACjD,OAAOd,UAAU,CAACY,KAAK,CAAC;IAC1B,CAAC,CAAC,CAAC;EACL;EAAC,QAAAG,CAAA,G;;AAdUb,gBAAgB,GAAAc,UAAA,EAD5BjB,UAAU,EAAE,C,EACAG,gBAAgB,CAe5B;SAfYA,gBAAgB"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|