Chore: Upgrade to Angular v18
Chore: Upgrade to Python 3.12 Chore: Upgrade to psycopg3
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { throwError } from 'rxjs';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ErrorLoggerService {
|
||||
public static log(serviceName = 'error-logger', message: string) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`${serviceName}Service: ${message}`);
|
||||
}
|
||||
|
||||
@@ -18,11 +16,10 @@ export class ErrorLoggerService {
|
||||
* @param operation - name of the operation that failed
|
||||
* @param result - optional value to return as the observable result
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
|
||||
public handleError<T>(serviceName = 'error-logger', operation = 'operation', result?: T) {
|
||||
public handleError<T>(serviceName = 'error-logger', operation = 'operation') {
|
||||
return (error: unknown): Observable<T> => {
|
||||
ErrorLoggerService.log(serviceName, `${operation} failed: ${error}`);
|
||||
return throwError(error);
|
||||
return throwError(() => error);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user