I tried to throw an observable error in the interceptor and then handles this error. but I can\'t. When success is false, I can also receive successful subscribe.
I
Try doing this in your interceptor
return next.handle(request).map((event: HttpEvent) => { if (event instanceof HttpResponse && !event.body.success) { throw new Error(event.body.message); } return event; );