axios 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of axios might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- // Axios v1.6.5 Copyright (c) 2024 Matt Zabriskie and contributors
1
+ // Axios v1.6.6 Copyright (c) 2024 Matt Zabriskie and contributors
2
2
  'use strict';
3
3
 
4
4
  function bind(fn, thisArg) {
@@ -2658,7 +2658,7 @@ function mergeConfig(config1, config2) {
2658
2658
  return config;
2659
2659
  }
2660
2660
 
2661
- const VERSION = "1.6.5";
2661
+ const VERSION = "1.6.6";
2662
2662
 
2663
2663
  const validators$1 = {};
2664
2664
 
@@ -2773,7 +2773,28 @@ class Axios {
2773
2773
  *
2774
2774
  * @returns {Promise} The Promise to be fulfilled
2775
2775
  */
2776
- request(configOrUrl, config) {
2776
+ async request(configOrUrl, config) {
2777
+ try {
2778
+ return await this._request(configOrUrl, config);
2779
+ } catch (err) {
2780
+ const dummy = {};
2781
+ if (Error.captureStackTrace) {
2782
+ Error.captureStackTrace(dummy);
2783
+ } else {
2784
+ dummy.stack = new Error().stack;
2785
+ }
2786
+ // slice off the Error: ... line
2787
+ dummy.stack = dummy.stack.replace(/^.+\n/, '');
2788
+ // match without the 2 top stack lines
2789
+ if (!err.stack.endsWith(dummy.stack.replace(/^.+\n.+\n/, ''))) {
2790
+ err.stack += '\n' + dummy.stack;
2791
+ }
2792
+
2793
+ throw err;
2794
+ }
2795
+ }
2796
+
2797
+ _request(configOrUrl, config) {
2777
2798
  /*eslint no-param-reassign:0*/
2778
2799
  // Allow for axios('example/url'[, config]) a la fetch API
2779
2800
  if (typeof configOrUrl === 'string') {