@agilecustoms/envctl 0.20.0 → 0.20.1

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.
@@ -46,19 +46,12 @@ export class HttpClient {
46
46
  return await response.text();
47
47
  }
48
48
  }
49
+ const message = await response.text();
49
50
  if (response.status === 404) {
50
- const message = await response.text();
51
51
  throw new NotFoundException(message);
52
52
  }
53
53
  if (response.status === 422) {
54
- let message = await response.text();
55
- let params;
56
- if (contentType.includes('application/json')) {
57
- const json = await response.json();
58
- message = json.message;
59
- params = json.params;
60
- }
61
- throw new BusinessException(message, params);
54
+ throw new BusinessException(message);
62
55
  }
63
56
  throw new HttpException(response.status, await response.text());
64
57
  }
@@ -22,11 +22,9 @@ export class HttpException extends Error {
22
22
  }
23
23
  export class BusinessException extends HttpException {
24
24
  message;
25
- params;
26
- constructor(message, params) {
25
+ constructor(message) {
27
26
  super(422, message);
28
27
  this.message = message;
29
- this.params = params;
30
28
  this.name = 'BusinessException';
31
29
  }
32
30
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilecustoms/envctl",
3
3
  "description": "node.js CLI client for manage environments",
4
- "version": "0.20.0",
4
+ "version": "0.20.1",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {