Skip to content

Commit

Permalink
fix: return some fields for response (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-envoy authored Jul 10, 2023
1 parent 5721bec commit 18d17f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@envoy/envoy-integrations-sdk",
"version": "2.0.0-beta.27",
"version": "2.0.0-beta.28",
"description": "SDK for building Envoy integrations.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions src/util/axiosConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ export function createAxiosClient(config?: AxiosRequestConfig | undefined): Axio
}, (error) => {
const safeError = {
code: error.code,
response: {
code: error.response?.code,
status: error.response?.status,
statusText: error.response?.statusText,
data: error.response?.data,
},
message: error.message,
name: error.name,
baseURL: error.request?.baseURL ?? error.config?.baseURL,
url: error.request?.url ?? error.config?.url,
method: error.request?.method ?? error.config?.method,
stack: error.stack,
data: error.data,
}
return Promise.reject(safeError);
});
Expand Down

0 comments on commit 18d17f6

Please sign in to comment.