Comparing version 10.1.2 to 11.0.0
{ | ||
"name": "netlify", | ||
"description": "Netlify Node.js API client", | ||
"version": "10.1.2", | ||
"version": "11.0.0", | ||
"type": "module", | ||
@@ -58,9 +58,9 @@ "files": [ | ||
"micro-api-client": "^3.3.0", | ||
"node-fetch": "^2.6.1", | ||
"node-fetch": "^3.0.0", | ||
"omit.js": "^2.0.2", | ||
"p-wait-for": "^3.2.0", | ||
"p-wait-for": "^4.0.0", | ||
"qs": "^6.9.6" | ||
}, | ||
"devDependencies": { | ||
"@netlify/eslint-config-node": "^4.1.3", | ||
"@netlify/eslint-config-node": "^5.1.4", | ||
"ava": "^3.0.0", | ||
@@ -67,0 +67,0 @@ "c8": "^7.11.0", |
@@ -13,3 +13,3 @@ import { JSONHTTPError, TextHTTPError } from 'micro-api-client' | ||
const ErrorType = responseType === 'json' ? JSONHTTPError : TextHTTPError | ||
throw new ErrorType(response, parsedResponse) | ||
throw addFallbackErrorMessage(new ErrorType(response, parsedResponse), textResponse) | ||
} | ||
@@ -38,9 +38,16 @@ | ||
} catch { | ||
throw new TextHTTPError(response, textResponse) | ||
throw addFallbackErrorMessage(new TextHTTPError(response, textResponse), textResponse) | ||
} | ||
} | ||
const addFallbackErrorMessage = function (error, textResponse) { | ||
error.message = error.message || textResponse | ||
return error | ||
} | ||
export const getFetchError = function (error, url, opts) { | ||
const data = omit.default(opts, ['Authorization']) | ||
error.name = 'FetchError' | ||
if (error.name !== 'FetchError') { | ||
error.name = 'FetchError' | ||
} | ||
error.url = url | ||
@@ -47,0 +54,0 @@ error.data = data |
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
20961
312
+ Addeddata-uri-to-buffer@4.0.1(transitive)
+ Addedfetch-blob@3.2.0(transitive)
+ Addedformdata-polyfill@4.0.10(transitive)
+ Addednode-domexception@1.0.0(transitive)
+ Addednode-fetch@3.3.2(transitive)
+ Addedp-timeout@5.1.0(transitive)
+ Addedp-wait-for@4.1.0(transitive)
+ Addedweb-streams-polyfill@3.3.3(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-timeout@3.2.0(transitive)
- Removedp-wait-for@3.2.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
Updatednode-fetch@^3.0.0
Updatedp-wait-for@^4.0.0