Skip to content

Commit

Permalink
SK-1621: update error structure
Browse files Browse the repository at this point in the history
  • Loading branch information
“amith-skyflow” committed Dec 9, 2024
1 parent 332fb11 commit 4176d21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/error/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SkyflowError extends Error {
constructor(errorCode: ISkyflowError, args: any[] = []) {
const formattedError = {
http_status: errorCode?.http_status || BAD_REQUEST,
details: errorCode?.details || null,
details: errorCode?.details || [],
request_ID: errorCode?.request_ID || null,
grpc_code: errorCode?.grpc_code || null,
http_code: errorCode.http_code,
Expand Down
2 changes: 1 addition & 1 deletion src/vault/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class VaultClient {
}

private handleGenericError(err: any, requestId: string, reject: Function) {
const description = err?.message || errorMessages.ERROR_OCCURRED;
const description = err?.response?.data || err?.message || errorMessages.ERROR_OCCURRED;
this.logAndRejectError(description, err, requestId, reject);
}

Expand Down

0 comments on commit 4176d21

Please sign in to comment.