javascript: report upload errors to Sentry
This commit is contained in:
parent
a6d6d72af5
commit
a3057afc22
2 changed files with 10 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import ProgressBar from './progress-bar';
|
||||
import { fire } from '@utils';
|
||||
|
||||
const INITIALIZE_EVENT = 'direct-upload:initialize';
|
||||
const START_EVENT = 'direct-upload:start';
|
||||
|
@ -36,8 +37,9 @@ addUploadEventListener(PROGRESS_EVENT, ({ detail: { id, progress } }) => {
|
|||
ProgressBar.progress(id, progress);
|
||||
});
|
||||
|
||||
addUploadEventListener(ERROR_EVENT, ({ detail: { id, error } }) => {
|
||||
ProgressBar.error(id, error);
|
||||
addUploadEventListener(ERROR_EVENT, event => {
|
||||
ProgressBar.error(event.detail.id, event.detail.error);
|
||||
fire(document, 'sentry:capture-exception', new Error(event.detail.error));
|
||||
});
|
||||
|
||||
addUploadEventListener(END_EVENT, ({ detail: { id } }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue