Format docs using linter and prettier.
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">src/app/_interceptors/error.interceptor.ts:14</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="15" class="link-to-prism">src/app/_interceptors/error.interceptor.ts:15</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -256,21 +256,21 @@
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {Injectable} from '@angular/core';
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor, HttpErrorResponse
|
||||
HttpInterceptor,
|
||||
HttpErrorResponse,
|
||||
} from '@angular/common/http';
|
||||
import {Observable, throwError} from 'rxjs';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
import {ErrorDialogService, LoggingService} from '@app/_services';
|
||||
import {Router} from '@angular/router';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { ErrorDialogService, LoggingService } from '@app/_services';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Injectable()
|
||||
export class ErrorInterceptor implements HttpInterceptor {
|
||||
|
||||
constructor(
|
||||
private errorDialogService: ErrorDialogService,
|
||||
private loggingService: LoggingService,
|
||||
@@ -287,11 +287,13 @@ export class ErrorInterceptor implements HttpInterceptor {
|
||||
} else {
|
||||
// The backend returned an unsuccessful response code.
|
||||
// The response body may contain clues as to what went wrong.
|
||||
errorMessage = `Backend returned code ${err.status}, body was: ${JSON.stringify(err.error)}`;
|
||||
errorMessage = `Backend returned code ${err.status}, body was: ${JSON.stringify(
|
||||
err.error
|
||||
)}`;
|
||||
}
|
||||
this.loggingService.sendErrorLevelMessage(errorMessage, this, {error: err});
|
||||
this.loggingService.sendErrorLevelMessage(errorMessage, this, { error: err });
|
||||
switch (err.status) {
|
||||
case 401: // unauthorized
|
||||
case 401: // unauthorized
|
||||
this.router.navigateByUrl('/auth').then();
|
||||
break;
|
||||
case 403: // forbidden
|
||||
|
||||
Reference in New Issue
Block a user