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

Commit

Permalink
Correctly handle errors from transaction decoder (#5341)
Browse files Browse the repository at this point in the history
We now correctly resolve the promise with undefined, causing the caller to display the raw log object.
  • Loading branch information
jeffsmale90 authored Mar 28, 2023
1 parent 61d10b0 commit f4142f9
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit f4142f9

Please sign in to comment.