You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RxJS 7, if you set useDeprecatedSynchronousErrorHandling = true, and you have a source that uses any operator, when you throw an error in the next handler, it's not rethrown. The first example was with take, but I've confirmed it also happens with map, concatMap, and others.
import{of,config}from"rxjs";import{take}from"rxjs/operators";console.clear();config.useDeprecatedSynchronousErrorHandling=true;try{of("test").pipe(take(1)).subscribe({next: value=>{console.log("value: ",value);thrownewError("test");}});}catch(err){// This is never hit in v7, but it is hit in v6.console.log("Caught!",err.message);}
We'll need to check takeUntil, takeWhile, and first for the same issues.
benlesh
changed the title
Errors are squeltched when thrown in next, after take, while useDeprecatedSynchronousErrorHandling = true;
Errors are squeltched when thrown in next, after any operator, while useDeprecatedSynchronousErrorHandling = true;
Jan 25, 2021
The apparent cause is that the new architecture "knows" that we don't synchronously rethrow in the common case. So when the error is synchronously rethrown, it unwinds the stack and is caught by the try-catch blocks in the OperatorSubscriber. We'll unfortunately need to work around this for the deprecated case. :\
benlesh
added a commit
to benlesh/rxjs
that referenced
this issue
Jan 25, 2021
In RxJS 7, if you set
useDeprecatedSynchronousErrorHandling = true
, and you have a source that uses any operator, when you throw an error in the next handler, it's not rethrown. The first example was withtake
, but I've confirmed it also happens withmap
,concatMap
, and others.https://stackblitz.com/edit/rxjs-fuauce?devtoolsheight=60
We'll need to check
takeUntil
,takeWhile
, andfirst
for the same issues.cc @leggechr
The text was updated successfully, but these errors were encountered: