Restore Error workaround in Bluebird to produce proper line numbers

I didn't really investigate this, but errors from the outside world seem
to not pass the "obj instanceof Error" test due to some weirdness that
Bluebird is doing. (When I took this out recently I thought we just were
throwing some custom errors that didn't properly extend Error, but that
isn't the issue.) This restores the earlier workaround.
This commit is contained in:
Dan Stillman 2015-02-05 18:39:43 -05:00
parent 3aaf9e341c
commit c322eaa1bc

View file

@ -4675,6 +4675,9 @@ function originatesFromRejection(e) {
}
function canAttachTrace(obj) {
// Added by Zotero
return obj.message && obj.stack && es5.propertyIsWritable(obj, "stack");
return obj instanceof Error && es5.propertyIsWritable(obj, "stack");
}