javascript: don't report connectivity issues to Sentry

This commit is contained in:
Pierre de La Morinerie 2020-04-15 14:35:39 +00:00
parent 55788990da
commit b2231e98d5
3 changed files with 17 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import Rails from '@rails/ujs';
import AutoUploadController from './auto-upload-controller.js';
import { FAILURE_CONNECTIVITY } from '../../shared/activestorage/file-upload-error';
// Manage multiple concurrent uploads.
//
@ -17,6 +18,11 @@ export default class AutoUploadsControllers {
try {
let controller = new AutoUploadController(input, file);
await controller.start();
} catch (error) {
// Report errors to Sentry (except connectivity issues)
if (error.failureReason != FAILURE_CONNECTIVITY) {
throw error;
}
} finally {
this._decrementInFlightUploads(form);
}