@klauswuestefeld/jux-web 2025.7.9 → 2025.9.26

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/dist/jux-web.js CHANGED
@@ -287,11 +287,11 @@ var juxWeb = (function (exports) {
287
287
  const requestInit = Object.assign(Object.assign({}, options), { headers, signal: controller.signal });
288
288
  if (onRedirect)
289
289
  requestInit.redirect = 'manual'; // Treat redirects manually instead of following them automatically.
290
- if (requestType === 'upload') {
291
- uploadRequest(url, options.file, onSuccess, onError, extras);
292
- return;
293
- }
294
290
  try {
291
+ if (requestType === 'upload') {
292
+ uploadRequest(url, options.file, onSuccess, onError, extras);
293
+ return;
294
+ }
295
295
  response = yield fetch(url, requestInit);
296
296
  }
297
297
  catch (err) {
@@ -343,7 +343,14 @@ var juxWeb = (function (exports) {
343
343
  return;
344
344
  }
345
345
  try {
346
- const jsonResponse = yield response.json();
346
+ let jsonResponse = {};
347
+ try {
348
+ jsonResponse = yield response.json();
349
+ }
350
+ catch (e) {
351
+ jsonResponse = { error: 'Unexpected response', expected: false };
352
+ console.error('Unexpected response', e, response);
353
+ }
347
354
  if (response.ok) {
348
355
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(jsonResponse);
349
356
  return;
package/dist/main.esm.js CHANGED
@@ -286,11 +286,11 @@ const backendRequest = (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1
286
286
  const requestInit = Object.assign(Object.assign({}, options), { headers, signal: controller.signal });
287
287
  if (onRedirect)
288
288
  requestInit.redirect = 'manual'; // Treat redirects manually instead of following them automatically.
289
- if (requestType === 'upload') {
290
- uploadRequest(url, options.file, onSuccess, onError, extras);
291
- return;
292
- }
293
289
  try {
290
+ if (requestType === 'upload') {
291
+ uploadRequest(url, options.file, onSuccess, onError, extras);
292
+ return;
293
+ }
294
294
  response = yield fetch(url, requestInit);
295
295
  }
296
296
  catch (err) {
@@ -342,7 +342,14 @@ const backendRequest = (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1
342
342
  return;
343
343
  }
344
344
  try {
345
- const jsonResponse = yield response.json();
345
+ let jsonResponse = {};
346
+ try {
347
+ jsonResponse = yield response.json();
348
+ }
349
+ catch (e) {
350
+ jsonResponse = { error: 'Unexpected response', expected: false };
351
+ console.error('Unexpected response', e, response);
352
+ }
346
353
  if (response.ok) {
347
354
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(jsonResponse);
348
355
  return;
package/dist/main.js CHANGED
@@ -310,11 +310,11 @@ const backendRequest = (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1
310
310
  const requestInit = Object.assign(Object.assign({}, options), { headers, signal: controller.signal });
311
311
  if (onRedirect)
312
312
  requestInit.redirect = 'manual'; // Treat redirects manually instead of following them automatically.
313
- if (requestType === 'upload') {
314
- uploadRequest(url, options.file, onSuccess, onError, extras);
315
- return;
316
- }
317
313
  try {
314
+ if (requestType === 'upload') {
315
+ uploadRequest(url, options.file, onSuccess, onError, extras);
316
+ return;
317
+ }
318
318
  response = yield fetch(url, requestInit);
319
319
  }
320
320
  catch (err) {
@@ -366,7 +366,14 @@ const backendRequest = (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1
366
366
  return;
367
367
  }
368
368
  try {
369
- const jsonResponse = yield response.json();
369
+ let jsonResponse = {};
370
+ try {
371
+ jsonResponse = yield response.json();
372
+ }
373
+ catch (e) {
374
+ jsonResponse = { error: 'Unexpected response', expected: false };
375
+ console.error('Unexpected response', e, response);
376
+ }
370
377
  if (response.ok) {
371
378
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(jsonResponse);
372
379
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klauswuestefeld/jux-web",
3
- "version": "2025.7.09",
3
+ "version": "2025.9.26",
4
4
  "author": "Jux.House",
5
5
  "license": "Copyrighted",
6
6
  "description": "",