Skip to content

Commit

Permalink
Fix contract error matching
Browse files Browse the repository at this point in the history
  • Loading branch information
faergeek committed Mar 14, 2023
1 parent 291898c commit 66e3e17
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ui/components/pages/swap/swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function Swap() {

// errors from nested invokes
let match = errMessage.match(
/error\s+while\s+executing\s+account-script:\s*\w+\(code\s*=\s*(?:.+),\s*error\s*=\s*([\s\S]+)\s*,\s*log\s*=/im
/Error while executing dApp: \w+\(code\s*=\s*(?:.+),\s*error\s*=\s*([\s\S]+)\s*,\s*log\s*=/im
);

if (match) {
Expand Down Expand Up @@ -206,9 +206,7 @@ export function Swap() {
}

// errors from contract itself
match = errMessage.match(
/error\s+while\s+executing\s+account-script:\s*([\s\S]+)/im
);
match = errMessage.match(/Error while executing dApp: ([\s\S]+)/im);

if (match) {
const [, msg] = match;
Expand Down

0 comments on commit 66e3e17

Please sign in to comment.