@shapediver/sdk.geometry-api-sdk-core
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -92,14 +92,15 @@ "use strict"; | ||
// Request was made and server responded with 4xx or 5xx | ||
const resp = error.response; | ||
let data; | ||
if (responseType === ShapeDiverSdkApiResponseType.DATA) { | ||
data = this.convertErrorResponseData(error.response.data); | ||
data = this.convertErrorResponseData(resp.data); | ||
} | ||
else { | ||
data = error.response.data; | ||
data = resp.data; | ||
} | ||
throw new ShapeDiverErrors_1.ShapeDiverResponseError(error.response.status, (_a = data.error) !== null && _a !== void 0 ? _a : "", (_b = data.desc) !== null && _b !== void 0 ? _b : "", data.message || ((_c = data.desc) !== null && _c !== void 0 ? _c : ""), error.response.headers); | ||
throw new ShapeDiverErrors_1.ShapeDiverResponseError(data.message || ((_a = data.desc) !== null && _a !== void 0 ? _a : ""), resp.status, (_b = data.error) !== null && _b !== void 0 ? _b : "", (_c = data.desc) !== null && _c !== void 0 ? _c : "", resp.headers); | ||
} | ||
else if (error.request) { | ||
// The request was made but no response was received | ||
throw new ShapeDiverErrors_1.ShapeDiverRequestError("The request was made but no response was received", error.request); | ||
throw new ShapeDiverErrors_1.ShapeDiverRequestError("Could not send request.", "The request was made but no response was received"); | ||
} | ||
@@ -106,0 +107,0 @@ else { |
@@ -15,3 +15,3 @@ export declare class ShapeDiverError extends Error { | ||
}; | ||
constructor(status: number, error: string, desc: string, message: string, headers: { | ||
constructor(message: string, status: number, error: string, desc: string, headers: { | ||
[key: string]: any; | ||
@@ -18,0 +18,0 @@ }); |
@@ -18,3 +18,3 @@ "use strict"; | ||
class ShapeDiverResponseError extends ShapeDiverError { | ||
constructor(status, error, desc, message, headers) { | ||
constructor(message, status, error, desc, headers) { | ||
super(message); | ||
@@ -21,0 +21,0 @@ this.status = status; |
{ | ||
"name": "@shapediver/sdk.geometry-api-sdk-core", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Core-library for SDK-packages to communicate with the Geometry API", | ||
@@ -38,3 +38,3 @@ "keywords": [], | ||
"dependencies": { | ||
"axios": "^0.26.0" | ||
"axios": "^0.26.1" | ||
}, | ||
@@ -44,4 +44,4 @@ "devDependencies": { | ||
"lerna": "3.22.1", | ||
"typescript": "^4.5.5" | ||
"typescript": "^4.6.3" | ||
} | ||
} |
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
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
38622
575
Updatedaxios@^0.26.1