Skip to content

Commit a9681f2

Browse files
committed
feat(api): Error object (not 2xx) includes statusCode property (as Fastify errors)
1 parent 2eebbe7 commit a9681f2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/api/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const api = async <T extends Config>(config: T): Promise<Response & {
5858
const error: any = new Error(response.statusText);
5959
error.config = config;
6060
error.response = response;
61+
error.statusCode = response.status;
6162
throw error;
6263
};
6364

0 commit comments

Comments
 (0)