Skip to content

Commit 3351237

Browse files
committed
AUTH-75. Add error status to request error handling
1 parent 5ec29d8 commit 3351237

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

ts/lib/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class EpicurusError extends Error {
2222
this.name = meta.name || this.name
2323
this.context = meta.context
2424
this.stack = (<any>new Error()).stack
25-
this.status = meta.stack || meta.status
25+
this.status = meta.status || meta.stack
2626
this.severity = meta.severity
2727
}
2828

ts/lib/request_response/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function request<T>(redisClient, channel: string, body: any): Promise<T>
5252

5353
if (response.error) {
5454
rej(new EpicurusError(response.error.message, {
55+
status: response.error.status,
5556
severity: response.error.severity,
5657
context: {
5758
context: { originalRequest: body, channel: channel },

0 commit comments

Comments
 (0)