Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yandex-cloud/axios-wrapper

Package Overview
Dependencies
Maintainers
6
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yandex-cloud/axios-wrapper - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

14

build/cjs/index.js

@@ -118,6 +118,16 @@ "use strict";

}
let errorResponse;
if (thrown.response) {
errorResponse = thrown.response;
}
else if (typeof thrown.toJSON === 'function') {
errorResponse = thrown.toJSON();
}
else {
errorResponse = thrown;
}
if (collectRequest) {
this.collectRequest(Object.assign(Object.assign({}, request), { requestStart, response: thrown.response, error: true, cancelled: axios_1.default.isCancel(thrown), responseError: thrown }));
this.collectRequest(Object.assign(Object.assign({}, request), { requestStart, response: errorResponse, error: true, cancelled: axios_1.default.isCancel(thrown), responseError: thrown }));
}
return this.handleRequestError(thrown.response, () => this.request(Object.assign(Object.assign({}, methodParams), { retries: retries + 1 })), retries, new Error(thrown instanceof Error ? thrown.message : 'Unknown error'));
return this.handleRequestError(errorResponse, () => this.request(Object.assign(Object.assign({}, methodParams), { retries: retries + 1 })), retries, new Error(thrown instanceof Error ? thrown.message : 'Unknown error'));
}

@@ -124,0 +134,0 @@ }

@@ -115,6 +115,16 @@ import cloneDeep from 'lodash/cloneDeep';

}
let errorResponse;
if (thrown.response) {
errorResponse = thrown.response;
}
else if (typeof thrown.toJSON === 'function') {
errorResponse = thrown.toJSON();
}
else {
errorResponse = thrown;
}
if (collectRequest) {
this.collectRequest(Object.assign(Object.assign({}, request), { requestStart, response: thrown.response, error: true, cancelled: axios.isCancel(thrown), responseError: thrown }));
this.collectRequest(Object.assign(Object.assign({}, request), { requestStart, response: errorResponse, error: true, cancelled: axios.isCancel(thrown), responseError: thrown }));
}
return this.handleRequestError(thrown.response, () => this.request(Object.assign(Object.assign({}, methodParams), { retries: retries + 1 })), retries, new Error(thrown instanceof Error ? thrown.message : 'Unknown error'));
return this.handleRequestError(errorResponse, () => this.request(Object.assign(Object.assign({}, methodParams), { retries: retries + 1 })), retries, new Error(thrown instanceof Error ? thrown.message : 'Unknown error'));
}

@@ -121,0 +131,0 @@ }

# Changelog
## [1.2.2](https://github.com/yandex-cloud/axios-wrapper/compare/v1.2.1...v1.2.2) (2022-07-15)
### Bug Fixes
* correctly handle errors with the missing response ([6b9dc0e](https://github.com/yandex-cloud/axios-wrapper/commit/6b9dc0eab2496aa21cd27e6044b5c6ab235210d1)), closes [#17](https://github.com/yandex-cloud/axios-wrapper/issues/17)
### [1.2.1](https://www.github.com/yandex-cloud/axios-wrapper/compare/v1.2.0...v1.2.1) (2022-04-05)

@@ -4,0 +11,0 @@

2

package.json
{
"name": "@yandex-cloud/axios-wrapper",
"version": "1.2.1",
"version": "1.2.2",
"description": "Generic helper class for wrapping axios calls",

@@ -5,0 +5,0 @@ "module": "build/esm/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc