attlaz-client 1.21.4 → 1.21.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.
@@ -15,6 +15,11 @@ export class ClientError extends Error {
15
15
  static fromError(error) {
16
16
  let clientError = new ClientError('Unknown error', HttpStatus.HTTP_INTERNAL_SERVER_ERROR);
17
17
  if (error instanceof AxiosError) {
18
+ if (error.code === 'ECONNREFUSED') {
19
+ clientError.httpStatus = HttpStatus.HTTP_UNAVAILABLE;
20
+ clientError.code = 'Service not available';
21
+ return clientError;
22
+ }
18
23
  if (error.status !== undefined) {
19
24
  clientError.httpStatus = error.status;
20
25
  }
@@ -29,7 +34,9 @@ export class ClientError extends Error {
29
34
  clientError.message = 'Connection refused';
30
35
  }
31
36
  else {
32
- console.error('Unable to parse AxiosError response', { error, x: error.status, y: error.code });
37
+ console.error('Unable to parse AxiosError response', {
38
+ error, status: error.status, code: error.code,
39
+ });
33
40
  }
34
41
  }
35
42
  else {
@@ -80,6 +87,8 @@ export class ClientError extends Error {
80
87
  else if (xError.code !== null && xError.code !== undefined) {
81
88
  switch (xError.code) {
82
89
  case 'EUNAVAILABLE':
90
+ case 'ECONNREFUSED':
91
+ case 'HTTP_UNAVAILABLE':
83
92
  clientError.httpStatus = HttpStatus.HTTP_UNAVAILABLE;
84
93
  break;
85
94
  case 'EAUTH':
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.21.3";
1
+ export declare const VERSION = "1.21.4";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.21.3";
1
+ export const VERSION = "1.21.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.21.4",
3
+ "version": "1.21.5",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",