New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Schedulers): Throwing a falsy error in a scheduled function no longer results in strange error objects. #6594
Conversation
@@ -63,7 +63,7 @@ describe('Scheduler.queue', () => { | |||
const actions: Subscription[] = []; | |||
let action2Exec = false; | |||
let action3Exec = false; | |||
let errorValue = undefined; | |||
let errorValue: any = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix CI ts@latest
expect(err.errors).to.deep.equal([err1, err2]); | ||
expect(err.name).to.equal('UnsubscriptionError'); | ||
expect(err.stack).to.be.a('string'); | ||
if (err instanceof UnsubscriptionError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix CI ts@latest
// HACK: Since code elsewhere is relying on the "truthiness" of the | ||
// return here, we can't have it return "" or 0 or false. | ||
// TODO: Clean this up when we refactor schedulers mid-version-8 or so. | ||
errorValue = e ? e : new Error('Falsy action error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix CI ts@latest and correct a weird bit of code that TS 4.4 helped catch.
…nger results in strange error objects. (ReactiveX#6594) * chore: fix TS 4.4 build in CI * chore: improve message
Because TS 4.4 now infers
unknown
forcatch
blocks, we had to make some adjustments.This also helped us catch a type problem where we were maybe creating
new Error(false)
ornew Error('')
, etc, in some cases.