Skip to content

Commit

Permalink
fix async_add_function exception handling (new-xkit#1849)
Browse files Browse the repository at this point in the history
  • Loading branch information
AprilSylph authored Jun 11, 2020
1 parent c2765ea commit 5fa8ef5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Extensions/xkit_patches.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE XKit Patches **//
//* VERSION 7.4.1 **//
//* VERSION 7.4.2 **//
//* DESCRIPTION Patches framework **//
//* DEVELOPER new-xkit **//

Expand Down Expand Up @@ -372,11 +372,11 @@ XKit.extensions.xkit_patches = new Object({
} catch (exception) {
window.postMessage({
xkit_callback_nonce: callback_nonce,
exception: {
exception: JSON.stringify({
...exception,
message: exception.message,
stack: exception.stack,
},
}),
})
}
})(add_tag)`;
Expand All @@ -388,7 +388,7 @@ XKit.extensions.xkit_patches = new Object({
const original_exception = data.exception && JSON.parse(data.exception);
const error = new Error(`Error in injected function (${original_exception.message})`);
error.cause = original_exception;
reject();
reject(error);
}
};

Expand Down

0 comments on commit 5fa8ef5

Please sign in to comment.