Merge pull request #5159 from betagouv/file-upload-really-mute-errors
This commit is contained in:
commit
0738c6ff18
1 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
import ProgressBar from './progress-bar';
|
||||
import {
|
||||
errorFromDirectUploadMessage,
|
||||
FAILURE_CONNECTIVITY
|
||||
ERROR_CODE_READ,
|
||||
FAILURE_CLIENT
|
||||
} from './file-upload-error';
|
||||
import { fire } from '@utils';
|
||||
|
||||
|
@ -58,8 +59,10 @@ addUploadEventListener(ERROR_EVENT, (event) => {
|
|||
|
||||
ProgressBar.error(id, errorMsg);
|
||||
|
||||
// Report unexpected client errors to Sentry.
|
||||
// (But ignore usual client errors, or errors we can monitor better on the server side.)
|
||||
let error = errorFromDirectUploadMessage(errorMsg);
|
||||
if (error.failureReason != FAILURE_CONNECTIVITY) {
|
||||
if (error.failureReason == FAILURE_CLIENT && error.code != ERROR_CODE_READ) {
|
||||
fire(document, 'sentry:capture-exception', error);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue