Skip to content

Commit

Permalink
fix: return the generic network message as JSON RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Sep 17, 2023
1 parent 1e85382 commit 843a693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ async function sendRequest(url: string, init: any) {
try {
return (await fetch(url, init)).result;
} catch (e: any) {
return { error: e.data?.error || e };
return { error: e.data?.error || { code: e.status, message: e.message } };
}
}

0 comments on commit 843a693

Please sign in to comment.