@remkoj/optimizely-cms-api 6.0.0-pre5 → 6.0.0-pre6

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.
@@ -102,13 +102,15 @@ const createClient = (config = {}) => {
102
102
  ...result,
103
103
  };
104
104
  }
105
- let error = await response.text();
105
+ const textError = await response.text();
106
+ let jsonError;
106
107
  try {
107
- error = JSON.parse(error);
108
+ jsonError = JSON.parse(textError);
108
109
  }
109
110
  catch {
110
111
  // noop
111
112
  }
113
+ const error = jsonError ?? textError;
112
114
  let finalError = error;
113
115
  for (const fn of interceptors.error._fns) {
114
116
  if (fn) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@remkoj/optimizely-cms-api",
3
3
  "displayName": "Optimizely CMS - Integration API Client",
4
4
  "description": "A Javascript client for the Integration API provided by the Optimizely CMS.",
5
- "version": "6.0.0-pre5",
5
+ "version": "6.0.0-pre6",
6
6
  "type": "commonjs",
7
7
  "license": "Apache-2.0",
8
8
  "main": "./dist/index.js",
@@ -12,17 +12,17 @@
12
12
  ],
13
13
  "devDependencies": {
14
14
  "@hey-api/client-fetch": "^0.13.1",
15
- "@hey-api/openapi-ts": "^0.78.2",
16
- "@types/node": "^22.16.2",
17
- "dotenv": "^17.1.0",
15
+ "@hey-api/openapi-ts": "^0.78.3",
16
+ "@types/node": "^22.16.4",
17
+ "dotenv": "^17.2.0",
18
18
  "dotenv-expand": "^12.0.2",
19
19
  "glob": "^11.0.3",
20
20
  "rimraf": "^6.0.1",
21
21
  "typescript": "^5.8.3"
22
22
  },
23
23
  "dependencies": {
24
- "@types/node": "^22.16.2",
25
- "dotenv": "^17.1.0",
24
+ "@types/node": "^22.16.4",
25
+ "dotenv": "^17.2.0",
26
26
  "glob": "^11.0.3",
27
27
  "openapi-typescript-codegen": "^0.29.0",
28
28
  "tslib": "^2.8.1",