Skip to content

Commit 67c77df

Browse files
committed
Added api details to client side errors
1 parent 97c7e89 commit 67c77df

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/client/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export async function getData(id: number, api: string, body?: any, options?: req
208208
// compile an error based on the data and throw it
209209
const error: any = new Error(data.error.message);
210210
error.name = data.error.name;
211+
error.api = api;
211212

212213
if (data.error.status) {
213214
error.status = data.error.status;
@@ -254,6 +255,7 @@ export async function sendData(id: number, api: string, body?: any, options?: re
254255
// compile an error based on the data and throw it
255256
const error: any = new Error(data.error.message);
256257
error.name = data.error.name;
258+
error.api = api;
257259

258260
if (data.error.status) {
259261
error.status = data.error.status;

out/client/index.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out/client/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)