Skip to content

Commit

Permalink
fix: update sdk error type
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Jul 26, 2024
1 parent 55ee090 commit 4274f08
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/dapp-toolkit/src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ const defaultErrorMessage = new Map<string, string>()
.set(ErrorType.rejectedByUser, 'user rejected request')
.set(ErrorType.canceledByUser, 'user has canceled the request')

export type SdkError = ReturnType<typeof SdkError>
export type SdkError = {
error: string
interactionId: string
message?: string
jsError?: unknown
}

export const SdkError = (
error: string,
interactionId: string,
message?: string,
jsError?: unknown,
) => ({
): SdkError => ({
error,
interactionId,
message: message || defaultErrorMessage.get(error) || '',
Expand Down

0 comments on commit 4274f08

Please sign in to comment.