Skip to content

Commit

Permalink
add data to fallback error
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Jan 29, 2024
1 parent 49f1b9f commit 7a5014c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/openlogin-jrpc/src/jrpcEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class JRPCEngine extends SafeEventEmitter {
message: error?.message || error?.toString(),
code: error?.code || -32603,
stack: error?.stack,
data: error?.data,
data: error?.data || error?.message || error?.toString(),
},
});
}
Expand Down Expand Up @@ -325,7 +325,7 @@ export class JRPCEngine extends SafeEventEmitter {
message: error?.message || error?.toString(),
code: (error as { code?: number })?.code || -32603,
stack: error?.stack,
data: (error as { data?: string })?.data,
data: (error as { data?: string })?.data || error?.message || error?.toString(),
},
});
}
Expand Down Expand Up @@ -416,7 +416,7 @@ export function providerFromEngine(engine: JRPCEngine): SafeEventEmitterProvider
message: res.error?.message || res.error?.toString(),
code: res.error?.code || -32603,
stack: res.error?.stack,
data: res.error?.data,
data: res.error?.data || res.error?.message || res.error?.toString(),
},
shouldIncludeStack: true,
});
Expand Down

0 comments on commit 7a5014c

Please sign in to comment.