Skip to content

Commit

Permalink
refactor: add more properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Oct 31, 2023
1 parent 4e08aac commit 90f3b80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export class BeeArgumentError extends BeeError {
export class BeeResponseError extends BeeError {
public constructor(
message: string,
public code?: string,
public axiosStatus?: string,
public status?: number,
public config?: AxiosRequestConfig,
public request?: any,

Check warning on line 22 in src/utils/error.ts

View workflow job for this annotation

GitHub Actions / check (16.x)

Unexpected any. Specify a different type
Expand Down
2 changes: 1 addition & 1 deletion src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function http<T>(options: BeeRequestOptions, config: AxiosRequestCo
return response
} catch (e: unknown) {
if (e instanceof AxiosError) {
throw new BeeResponseError(e.message, e.response?.status, e.config, e.request, e.response)
throw new BeeResponseError(e.message, e.code, e.status, e.response?.status, e.config, e.request, e.response)
}
throw e
}
Expand Down

0 comments on commit 90f3b80

Please sign in to comment.