Skip to content

Commit

Permalink
fix toString() issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Jan 26, 2024
1 parent dc79ebb commit ec1f3dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/openlogin-jrpc/src/jrpcEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export class JRPCEngine extends SafeEventEmitter {
res.error = serializeError(error, {
shouldIncludeStack: true,
fallbackError: {
message: res.error?.message || res.error.toString(),
code: res.error?.code || -32603,
stack: res.error?.stack,
data: res.error?.data,
message: error?.message || error?.toString(),
code: error?.code || -32603,
stack: error?.stack,
data: error?.data,
},
});
}
Expand Down Expand Up @@ -322,7 +322,7 @@ export class JRPCEngine extends SafeEventEmitter {
res.error = serializeError(error, {
shouldIncludeStack: true,
fallbackError: {
message: error?.message || error.toString(),
message: error?.message || error?.toString(),
code: (error as { code?: number })?.code || -32603,
stack: error?.stack,
data: (error as { data?: string })?.data,
Expand Down Expand Up @@ -413,7 +413,7 @@ export function providerFromEngine(engine: JRPCEngine): SafeEventEmitterProvider
if (res.error) {
const err = serializeError(res.error, {
fallbackError: {
message: res.error?.message || res.error.toString(),
message: res.error?.message || res.error?.toString(),
code: res.error?.code || -32603,
stack: res.error?.stack,
data: res.error?.data,
Expand Down

0 comments on commit ec1f3dd

Please sign in to comment.