@stemy/backend 3.5.15 → 3.5.16
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.
|
@@ -2616,17 +2616,20 @@
|
|
|
2616
2616
|
Progress.prototype.advance = function (value) {
|
|
2617
2617
|
if (value === void 0) { value = 1; }
|
|
2618
2618
|
return __awaiter$s(this, void 0, void 0, function () {
|
|
2619
|
+
var status;
|
|
2619
2620
|
return __generator(this, function (_a) {
|
|
2620
2621
|
switch (_a.label) {
|
|
2621
2622
|
case 0:
|
|
2622
2623
|
if (isNaN(value) || value <= 0) {
|
|
2623
|
-
throw "Advance value must be bigger than zero";
|
|
2624
|
+
throw new Error("Advance value must be bigger than zero: " + this.id);
|
|
2624
2625
|
}
|
|
2625
2626
|
return [4 /*yield*/, this.load()];
|
|
2626
2627
|
case 1:
|
|
2627
2628
|
_a.sent();
|
|
2628
|
-
if (this.deleted || this.canceled)
|
|
2629
|
-
|
|
2629
|
+
if (this.deleted || this.canceled) {
|
|
2630
|
+
status = this.deleted ? "deleted" : "canceled";
|
|
2631
|
+
throw new Error("Can't advance " + status + " progress: " + this.id);
|
|
2632
|
+
}
|
|
2630
2633
|
this.data.current = Math.min(this.max, this.current + value);
|
|
2631
2634
|
return [4 /*yield*/, this.save()];
|
|
2632
2635
|
case 2:
|