javascript: don't report connectivity issues to Sentry
This commit is contained in:
parent
55788990da
commit
b2231e98d5
3 changed files with 17 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import ProgressBar from './progress-bar';
|
||||
import { errorFromDirectUploadMessage } from './file-upload-error';
|
||||
import {
|
||||
errorFromDirectUploadMessage,
|
||||
FAILURE_CONNECTIVITY
|
||||
} from './file-upload-error';
|
||||
import { fire } from '@utils';
|
||||
|
||||
const INITIALIZE_EVENT = 'direct-upload:initialize';
|
||||
|
@ -56,7 +59,9 @@ addUploadEventListener(ERROR_EVENT, event => {
|
|||
ProgressBar.error(id, errorMsg);
|
||||
|
||||
let error = errorFromDirectUploadMessage(errorMsg);
|
||||
fire(document, 'sentry:capture-exception', error);
|
||||
if (error.failureReason != FAILURE_CONNECTIVITY) {
|
||||
fire(document, 'sentry:capture-exception', error);
|
||||
}
|
||||
});
|
||||
|
||||
addUploadEventListener(END_EVENT, ({ detail: { id } }) => {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import { DirectUpload } from '@rails/activestorage';
|
||||
import { ajax } from '@utils';
|
||||
import ProgressBar from './progress-bar';
|
||||
import FileUploadError, { errorFromDirectUploadMessage, ERROR_CODE_ATTACH } from './file-upload-error';
|
||||
import FileUploadError, {
|
||||
errorFromDirectUploadMessage,
|
||||
ERROR_CODE_ATTACH
|
||||
} from './file-upload-error';
|
||||
|
||||
/**
|
||||
Uploader class is a delegate for DirectUpload instance
|
||||
|
|
Loading…
Reference in a new issue