lambda-essentials-ts 5.1.3 → 5.1.5

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
 
7
+ ## [5.1.5] - 2022-11-15
8
+
9
+ ### Changed
10
+
11
+ The fix described in 5.1.4 missed one instance where the bug can occur. This change covers all known instances.
12
+
13
+ ## [5.1.4] - 2022-11-08
14
+
15
+ ### Changed
16
+
17
+ Using `baseURL` in the axios config without specifying the full URL resulted in an error in the exception handling. So the `AxiosError` was thrown instead of a customer `ClientException`.
18
+
7
19
  ## [5.1.3] - 2022-10-03
8
20
 
9
21
  ### Changed
@@ -122,7 +122,9 @@ class HttpClient {
122
122
  ...HttpClient.extractRequestLogData(error.config),
123
123
  error: serializedAxiosError,
124
124
  });
125
- const hostname = ((_a = error.config) === null || _a === void 0 ? void 0 : _a.url) ? new url_1.URL(error.config.url).hostname : 'N/A';
125
+ const hostname = ((_a = error.config) === null || _a === void 0 ? void 0 : _a.url)
126
+ ? new url_1.URL(error.config.url, error.config.baseURL).hostname
127
+ : 'N/A';
126
128
  throw new clientException_1.ClientException(hostname, serializedAxiosError === null || serializedAxiosError === void 0 ? void 0 : serializedAxiosError.status, serializedAxiosError === null || serializedAxiosError === void 0 ? void 0 : serializedAxiosError.details);
127
129
  });
128
130
  this.client.interceptors.response.use((response) => {
@@ -159,7 +161,9 @@ class HttpClient {
159
161
  error: serializedAxiosError,
160
162
  });
161
163
  }
162
- const hostname = ((_a = error.config) === null || _a === void 0 ? void 0 : _a.url) ? new url_1.URL(error.config.url).hostname : 'N/A';
164
+ const hostname = ((_a = error.config) === null || _a === void 0 ? void 0 : _a.url)
165
+ ? new url_1.URL(error.config.url, error.config.baseURL).hostname
166
+ : 'N/A';
163
167
  throw new clientException_1.ClientException(hostname, serializedAxiosError === null || serializedAxiosError === void 0 ? void 0 : serializedAxiosError.status, serializedAxiosError === null || serializedAxiosError === void 0 ? void 0 : serializedAxiosError.details);
164
168
  });
165
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lambda-essentials-ts",
3
- "version": "5.1.3",
3
+ "version": "5.1.5",
4
4
  "description": "A selection of the finest modules supporting authorization, API routing, error handling, logging and sending HTTP requests.",
5
5
  "main": "lib/index.js",
6
6
  "private": false,