@dev-crew-berlin/enter-js-utils 0.36.1 → 0.37.0

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.
@@ -78,7 +78,8 @@ export default class APIBase {
78
78
  return failure([{
79
79
  type: 'http-error',
80
80
  statusCode: 401,
81
- endpoint
81
+ endpoint,
82
+ message: res.data.statusText
82
83
  }]);
83
84
  }
84
85
  if (res.data.status >= 300) {
@@ -87,14 +88,14 @@ export default class APIBase {
87
88
  return failure([{
88
89
  type: 'http-error',
89
90
  statusCode: res.data.status,
90
- message: error.error,
91
+ message: error.error ?? res.data.statusText,
91
92
  endpoint
92
93
  }]);
93
94
  } catch (e) {
94
95
  return failure([{
95
96
  type: 'http-error',
96
97
  statusCode: res.data.status,
97
- message: `invalid response from backend: ${res.data.status} for: ${endpoint}`,
98
+ message: `invalid response from backend: ${res.data.status} (${res.data.statusText}) for: ${endpoint}`,
98
99
  endpoint
99
100
  }]);
100
101
  }
@@ -8,7 +8,7 @@ export declare type HTTPError = {
8
8
  type: 'http-error';
9
9
  endpoint: string;
10
10
  statusCode: number;
11
- message?: string;
11
+ message: string | null;
12
12
  };
13
13
  export declare type ClientError = {
14
14
  type: 'client-error';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-crew-berlin/enter-js-utils",
3
- "version": "0.36.1",
3
+ "version": "0.37.0",
4
4
  "description": "utils such as vaildation and other helpers to work with data from the enter app",
5
5
  "files": [
6
6
  "dist",