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
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="11" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:11</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="6" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:6</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -136,8 +136,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="15"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:15</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="9"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:9</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -203,17 +203,11 @@
|
||||
|
||||
<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';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor
|
||||
} from '@angular/common/http';
|
||||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class HttpConfigInterceptor implements HttpInterceptor {
|
||||
|
||||
constructor() {}
|
||||
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
|
||||
@@ -166,8 +166,8 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="20"
|
||||
class="link-to-prism">src/app/_interceptors/logging.interceptor.ts:20</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="17"
|
||||
class="link-to-prism">src/app/_interceptors/logging.interceptor.ts:17</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -238,18 +238,15 @@ import {
|
||||
HttpHandler,
|
||||
HttpEvent,
|
||||
HttpInterceptor,
|
||||
HttpResponse
|
||||
HttpResponse,
|
||||
} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
import {LoggingService} from '@app/_services/logging.service';
|
||||
import {finalize, tap} from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs';
|
||||
import { LoggingService } from '@app/_services/logging.service';
|
||||
import { finalize, tap } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class LoggingInterceptor implements HttpInterceptor {
|
||||
|
||||
constructor(
|
||||
private loggingService: LoggingService
|
||||
) {}
|
||||
constructor(private loggingService: LoggingService) {}
|
||||
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
return next.handle(request);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user