@zac-apps/commons 1.3.5-beta.2 → 1.3.5-beta.4
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/index.js +13 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -439,15 +439,24 @@ function PublicFetch(_ref) {
|
|
|
439
439
|
SetMetaData = _ref.SetMetaData,
|
|
440
440
|
reload = _ref.reload,
|
|
441
441
|
SetReload = _ref.SetReload;
|
|
442
|
+
_ref.error;
|
|
443
|
+
var SetError = _ref.SetError;
|
|
442
444
|
var _useState = useState(),
|
|
443
445
|
_useState2 = _slicedToArray(_useState, 2),
|
|
444
446
|
internal = _useState2[0],
|
|
445
447
|
SetInternal = _useState2[1];
|
|
448
|
+
var _useState3 = useState(),
|
|
449
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
450
|
+
_useState4[0];
|
|
451
|
+
var SetInternalError = _useState4[1];
|
|
446
452
|
var state = null;
|
|
447
453
|
if (!SetState) {
|
|
448
454
|
SetState = SetInternal;
|
|
449
455
|
state = internal;
|
|
450
456
|
}
|
|
457
|
+
if (!SetError) {
|
|
458
|
+
SetError = SetInternalError;
|
|
459
|
+
}
|
|
451
460
|
if (!reload) {
|
|
452
461
|
reload = false;
|
|
453
462
|
}
|
|
@@ -464,6 +473,9 @@ function PublicFetch(_ref) {
|
|
|
464
473
|
}
|
|
465
474
|
console.log(response);
|
|
466
475
|
if (!response.ok) {
|
|
476
|
+
SetError({
|
|
477
|
+
error: response.statusText
|
|
478
|
+
});
|
|
467
479
|
return {
|
|
468
480
|
error: response.statusText
|
|
469
481
|
};
|
|
@@ -476,7 +488,7 @@ function PublicFetch(_ref) {
|
|
|
476
488
|
});
|
|
477
489
|
} catch (e) {
|
|
478
490
|
console.log(e);
|
|
479
|
-
|
|
491
|
+
SetError({
|
|
480
492
|
error: e
|
|
481
493
|
});
|
|
482
494
|
}
|