send errors to Raven

This commit is contained in:
Daniela Arcese 2017-07-07 10:37:10 -04:00
parent 63fe2c7099
commit 7ccf89b43b
2 changed files with 5 additions and 3 deletions

View File

@ -51,8 +51,8 @@ class FileSender extends EventEmitter {
reader.onload = function(event) {
resolve(new Uint8Array(this.result));
};
reader.onerror = function(event) {
reject(event.explicitOriginalTarget.error.name);
reader.onerror = function(err) {
reject(err);
};
})
])

View File

@ -2,6 +2,8 @@ const FileSender = require('./fileSender');
const { notify } = require('./utils');
const $ = require('jquery');
const Raven = window.Raven;
$(document).ready(function() {
// reset copy button
const $copyBtn = $('#copy-btn');
@ -102,7 +104,7 @@ $(document).ready(function() {
notify('Your upload has finished.');
})
.catch(err => {
console.log('Upload error name: ' + err);
Raven.captureException(err);
$('#page-one').hide();
$('#upload-error').show();
});