Add setting environment variables using commandline arguments.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {Injectable, isDevMode} from '@angular/core';
|
||||
import {
|
||||
HttpRequest,
|
||||
HttpHandler,
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
import {Observable, throwError} from 'rxjs';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
import {ErrorDialogService} from '@app/_services';
|
||||
import {environment} from '@src/environments/environment';
|
||||
|
||||
@Injectable()
|
||||
export class ErrorInterceptor implements HttpInterceptor {
|
||||
@@ -17,7 +16,7 @@ export class ErrorInterceptor implements HttpInterceptor {
|
||||
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
return next.handle(request).pipe(catchError((err: HttpErrorResponse) => {
|
||||
if (!environment.production) {
|
||||
if (isDevMode()) {
|
||||
this.errorDialogService.openDialog({
|
||||
message: err.error.message || err.statusText || 'Unknown Error',
|
||||
status: err.status || 0
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, isDevMode} from '@angular/core';
|
||||
import {NGXLogger} from 'ngx-logger';
|
||||
import {environment} from '@src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -11,9 +10,7 @@ export class LoggingService {
|
||||
|
||||
constructor(private logger: NGXLogger) {
|
||||
// TRACE|DEBUG|INFO|LOG|WARN|ERROR|FATAL|OFF
|
||||
this.env = environment.production ? 'Production' : 'Development';
|
||||
|
||||
if (this.env === 'Development') {
|
||||
if (isDevMode()) {
|
||||
this.sendInfoLevelMessage('Dropping into debug mode');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user