Skip to content

Commit

Permalink
better error throw
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Jul 2, 2024
1 parent 29e01d6 commit 70b7ad0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/constructTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ export async function signAndBroadcastEVM(
return txHash ?? uoHash;
} catch (error) {
console.log(error);
// @ts-ignore
if (error.message && error.message.includes('Details: ')) {
// @ts-ignore
const splitted = error.message.split('Details: ');
const lastDetail = splitted[splitted.length - 1];
// throw just this last detail
throw new Error(lastDetail);
}
throw error;
}
}

0 comments on commit 70b7ad0

Please sign in to comment.