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) { reader.onload = function(event) {
resolve(new Uint8Array(this.result)); resolve(new Uint8Array(this.result));
}; };
reader.onerror = function(event) { reader.onerror = function(err) {
reject(event.explicitOriginalTarget.error.name); reject(err);
}; };
}) })
]) ])

View File

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