-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
Errors #510
Errors #510
Conversation
…sync.read because there was an error that wasn't getting caught in the async api
jimpInstance.emitError('constructor', err); | ||
} else { |
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.
I am not sure why you want to change the behavior of this ?
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.
(The rest looks good to me)
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.
If jimp emits the error then the callback will never be called with error, and the promise never catches the error. this change makes it so that jimp either
- calls the callback with the error
- rejects with the error
- or if no callback or promise is provided it emits the error
when we were calling emitError the whole exectution of the program would stop if you didn't have an on('error')
. All the issues basically arose from just this.
closes #420
closes #422
closes #454
closes #347
closes #353
closes #408
Small code change, big impact 🎉