@blizzard-api/client
Advanced tools
Comparing version 0.2.0 to 0.2.1
// src/client/client.ts | ||
import { stringify } from "querystring"; | ||
import { getBlizzardApi } from "@blizzard-api/core"; | ||
import axios from "axios"; | ||
import axios, { AxiosError, isAxiosError } from "axios"; | ||
var BlizzardApiClient = class { | ||
@@ -41,6 +41,13 @@ defaults; | ||
} | ||
sendRequest(resource, options, headers) { | ||
async sendRequest(resource, options, headers) { | ||
const url = this.getRequestUrl(resource, options); | ||
const config = this.getRequestConfig(resource, options, headers); | ||
return this.axios.get(url, config); | ||
try { | ||
return await this.axios.get(url, config); | ||
} catch (error) { | ||
if (!isAxiosError(error)) { | ||
throw error; | ||
} | ||
throw new AxiosError(error.message, error.code); | ||
} | ||
} | ||
@@ -47,0 +54,0 @@ getAccessToken = async (options) => { |
{ | ||
"name": "@blizzard-api/client", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -54,3 +54,3 @@ "author": "Putro", | ||
"@blizzard-api/core": "0.1.0", | ||
"@blizzard-api/wow": "0.2.0" | ||
"@blizzard-api/wow": "0.2.1" | ||
}, | ||
@@ -57,0 +57,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39375
372