Convert throwHumanError to custom error type

Now with 200% more helpful stack traces.

// FREEBIE
This commit is contained in:
lilia 2015-07-10 11:28:47 -07:00
parent e86c40d3a8
commit 3711e0a6cd
6 changed files with 111 additions and 128 deletions

View file

@ -120,7 +120,7 @@
function onError(ev) {
var e = ev.error;
if (e.name === 'HTTPError' && (e.message == 401 || e.message == 403)) {
if (e.name === 'HTTPError' && (e.code == 401 || e.code == 403)) {
extension.install();
return;
}
@ -129,6 +129,7 @@
console.log(e);
throw e;
}
var envelope = ev.proto;
var message = initIncomingMessage(envelope.source, envelope.timestamp.toNumber());
if (e.name === 'IncomingIdentityKeyError') {