Skip to content
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

core: Only catch errors from onBeforeUpload #246

Merged

Conversation

goto-bus-stop
Copy link
Contributor

Previously this code would treat any error at all as an onBeforeUpload
error, and show the informer. We also lost the stack trace for errors
because err is stringified in the handler. This is correct for
onBeforeUpload rejections, since they are string reasons, but not for
other errors.

Now only actual onBeforeUpload errors are handled that way, and fatal
upload errors end up in the StatusBar like before and in the console,
with a stack trace.

Previously this code would treat any error at all as an `onBeforeUpload`
error, and show the informer. We also lost the stack trace for errors
because `err` is stringified in the handler. This is correct for
`onBeforeUpload` rejections, since they are string reasons, but not for
other errors.

Now only actual `onBeforeUpload` errors are handled that way, and fatal
upload errors end up in the StatusBar like before and in the console,
with a stack trace.
@goto-bus-stop goto-bus-stop requested a review from arturi July 7, 2017 14:31
@arturi
Copy link
Contributor

arturi commented Jul 7, 2017

Cool! What about onBeforeFileAdded ?

@goto-bus-stop
Copy link
Contributor Author

Good catch, I forgot about that :') Thanks! Addressed in b763e15

@arturi arturi merged commit 46b14b0 into transloadit:master Jul 9, 2017
@arturi
Copy link
Contributor

arturi commented Jul 9, 2017

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants