Skip to content

Commit

Permalink
Fix #1: update axios version (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pogix3m committed Dec 8, 2022
1 parent 900854f commit b4e7a82
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# ts
# HTTP

Axios wrapper
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pogix3m/http",
"version": "1.0.0",
"version": "1.0.1",
"description": "Make http request using axios",
"main": "dist/index.js",
"engines": {
Expand Down Expand Up @@ -39,7 +39,7 @@
"typescript": "4.6.3"
},
"dependencies": {
"axios": "1.2.0",
"uuid": "9.0.0"
"axios": "^1.2.1",
"uuid": "^9.0.0"
}
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export class HTTPError extends Error {
}

public constructor(error: AxiosError, options?: Record<string, unknown>) {
const code: string = error.response?.status?.toString() || error.code?.toString() || "Unknown Code";
const message: string = error.response?.statusText || error.message || "Unknown error message";
super(
`${ error.response?.status || "N/A" }: ${ error.response?.statusText || "Unknown error response" }`,
`${ code }: ${ message }`,
);
this.data = {
...options,
Expand Down

0 comments on commit b4e7a82

Please sign in to comment.