Avoid logging http errors in production mode

[ci skip]
pull/8248/head
Oliver Günther 5 years ago
parent bb0642c43e
commit 30c6beaa33
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 3
      frontend/src/app/modules/hal/services/hal-resource.service.ts

@ -44,6 +44,7 @@ import {
HTTPClientParamMap,
HTTPSupportedMethods
} from "core-app/modules/hal/http/http.interfaces";
import {whenDebugging} from "core-app/helpers/debug_output";
export interface HalResourceFactoryConfigInterface {
cls?:any;
@ -89,7 +90,7 @@ export class HalResourceService {
.pipe(
map((response:any) => this.createHalResource(response)),
catchError((error:HttpErrorResponse) => {
console.error(`Failed to ${method} ${href}: ${error.name}`);
whenDebugging(() => console.error(`Failed to ${method} ${href}: ${error.name}`));
const resource = this.createHalResource<ErrorResource>(error.error);
resource.httpError = error;
return throwError(resource);

Loading…
Cancel
Save