Skip to content

Commit

Permalink
Merge pull request #192 from argentlabs/fix/ww-error-messages
Browse files Browse the repository at this point in the history
fix: update webwallet error messages for connect and sign
  • Loading branch information
bluecco authored Feb 26, 2025
2 parents 213c08b + cf917f6 commit 0ce02c2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/connectors/webwallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ export class WebWalletConnector extends Connector {
error.name === "TRPCClientError")
) {
const trpcError = error as TRPCClientError<any>
throw new ConnectAndSignSessionError(
trpcError.message,
trpcError.shape.message,
)

const message =
trpcError.shape.data.webwalletErrorMessage || trpcError.message
const code =
trpcError.shape.data.webwalletErrorCode || trpcError.shape.message

throw new ConnectAndSignSessionError(message, code)
}
throw new Error(error instanceof Error ? error.message : String(error))
}
Expand Down

0 comments on commit 0ce02c2

Please sign in to comment.