Skip to content
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
30 changes: 20 additions & 10 deletions frontend/app/src/services/TransactionFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -548,19 +548,29 @@ function useFlowManager(account: Address | null, isSafe: boolean = false) {
error: null,
});
} catch (error) {
const insufficientFunds = error instanceof Error
&& /insufficient funds for gas/i.test(error.message);

updateFlowStep(stepIndex, {
status: "error",
artifact: currentArtifact,
error:
error instanceof Error
? {
name:
error.name.toLowerCase().trim() === "error"
? null
: error.name,
message: error.message,
}
: { name: null, message: String(error) },
error: insufficientFunds
? {
name: null,
message:
"You don't have enough ETH in your wallet to cover the gas"
+ " deposit and transaction fees. Please add more ETH and try"
+ " again.",
}
: error instanceof Error
? {
name:
error.name.toLowerCase().trim() === "error"
? null
: error.name,
message: error.message,
}
: { name: null, message: String(error) },
});
console.error(`Error at step ${stepIndex}:`, error);
} finally {
Expand Down