Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix: correctly handle errors from transaction decoder #5341

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ class TruffleIntegrationService extends EventEmitter {
return new Promise((resolve, reject) => {
if (this.child !== null && this.child.connected) {
this.once("decode-transaction-response", data => {
if (typeof data === "object") {
resolve(data);
if (data && data.error) {
reject(data.error);
} else {
reject(data);
// data may be `undefined`, in which case the raw event will be displayed
// see https://github.com/trufflesuite/ganache-ui/issues/3805 for details
resolve(data);
}
});

Expand Down