I would like to perform error handling in the use case method using the subscription. If an error is thrown in the adapter, the handling should be performed in the use case. Unfortunately, the catch does not work with the example below, only the error from the adapter is thrown.
public checkInUsecase(): void {
this.checkInAdapter().subscribe(
(data) => {
this.logger.debug('Work...');
},
(error) => {
this.logger.error('Error.');
},
() => {
this.logger.debug('Successful.');
}
);
}
public checkInAdapter(): Observable<boolean> {
throw new Error('Check in error');
}
catchErroroperator rxjs.dev/api/operators/catchError