mobx-tanstack-query-api 0.0.110 → 0.0.112
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/package.json +1 -1
- package/runtime/http-client.js +2 -2
package/package.json
CHANGED
package/runtime/http-client.js
CHANGED
|
@@ -5,7 +5,7 @@ export const isHttpResponse = (response, status) => !!response &&
|
|
|
5
5
|
'data' in response &&
|
|
6
6
|
(!status || response.status === status);
|
|
7
7
|
export const isHttpBadResponse = (response) => {
|
|
8
|
-
return isHttpResponse(response) && !response.ok;
|
|
8
|
+
return isHttpResponse(response) && (!response.ok || !!response.error);
|
|
9
9
|
};
|
|
10
10
|
export class HttpClient {
|
|
11
11
|
config;
|
|
@@ -135,7 +135,7 @@ export class HttpClient {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
if (!response.ok) {
|
|
138
|
+
if (!response.ok || response.error) {
|
|
139
139
|
this.setBadResponse(response);
|
|
140
140
|
throw response;
|
|
141
141
|
}
|