@dexyn/common-library 1.0.11 → 1.0.12

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.
@@ -39,12 +39,13 @@ const createApiClient = (basePath) => {
39
39
  });
40
40
  if (!response.ok) {
41
41
  const errorData = await response.json();
42
- throw new Error(`Request failed with status ${response.status}: ${JSON.stringify(errorData)}`);
42
+ return errorData;
43
43
  }
44
44
  // Handle no content for 202 or other no-body status codes
45
45
  if (response.status === 202 || response.status === 204 || !response.headers.get('Content-Type')) {
46
46
  return {};
47
47
  }
48
+ // Return parsed JSON for non-void responses
48
49
  return await response.json();
49
50
  };
50
51
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexyn/common-library",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",