@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
33import { HttpEvent , HttpInterceptor , HttpHandler , HttpRequest , HttpErrorResponse } from '@angular/common/http' ;
44
55/** rxjs Imports */
6- import { Observable } from 'rxjs' ;
6+ import { EMPTY , Observable } from 'rxjs' ;
77import { catchError } from 'rxjs/operators' ;
88
99/** Environment Configuration */
@@ -50,7 +50,9 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
5050 }
5151 }
5252
53- if ( ! environment . production ) {
53+ const isClientImage404 = status === 404 && request . url . includes ( '/clients/' ) && request . url . includes ( '/images' ) ;
54+
55+ if ( ! environment . production && ! isClientImage404 ) {
5456 log . error ( `Request Error: ${ errorMessage } ` ) ;
5557 }
5658
@@ -70,10 +72,10 @@ export class ErrorHandlerInterceptor implements HttpInterceptor {
7072 } ) ;
7173 } else if ( status === 404 ) {
7274 // Check if this is an image request that should be silently handled (client profile image)
73- if ( request . url . includes ( '/clients/' ) && request . url . includes ( '/images' ) ) {
75+ if ( isClientImage404 ) {
7476 // Don't show alerts for missing client images
7577 // This is an expected condition, not an error
76- return new Observable < HttpEvent < any > > ( ) ;
78+ return EMPTY ;
7779 } else {
7880 this . alertService . alert ( {
7981 type : this . translate . instant ( 'error.resource.not.found' ) ,
0 commit comments