Commit graph

4 commits

Author SHA1 Message Date
Pierre de La Morinerie
6f4075f38e javascript: fix FileUploadError stacktraces
When subclassing a JS error, most browsers include the constructor
stacktrace :/

This is an issue, because:
- The stacktrace is deeper than it should be
- The stacktrace reaches into a polyfill for which there is not source
map, which causes Sentry to infer the issue grouping from the JS file
name. And the fingerprinted name changes on each release. So for each
release, the stacktrace is different ; and Sentry can't group issues
properly.
2020-04-23 12:27:26 +02:00
Pierre de La Morinerie
647ad3ba10 javascript: consider unknown upload errors as client errors 2020-04-16 12:59:14 +02:00
Pierre de La Morinerie
b006c33ebe javascript: parse the upload status code correctly
Previously the status was "Status: 422" instead of just 422.
2020-04-16 12:54:18 +02:00
Pierre de La Morinerie
432967bd76 javascript: make Uploader always throw the same kind of errors
A DirectUpload may fail for several reasons, and return many types of
errors (string, xhr response, Error objects, etc).

For convenience, wrap all these errors in a FileUploadError object.

- It makes easier for clients of the Uploader class to handle errors;
- It allows to propagate the error code and failure responsability.
2020-04-16 11:20:45 +02:00