Fix errors
This commit is contained in:
parent
0a6d08a105
commit
694a3fffb4
@ -11,6 +11,7 @@ export class CheckBuildingRemainingTimeAction extends ActionController {
|
|||||||
const remainingSeconds = Number(timer.attr('value'));
|
const remainingSeconds = Number(timer.attr('value'));
|
||||||
if (remainingSeconds > 0) {
|
if (remainingSeconds > 0) {
|
||||||
throw new BuildingQueueFullError(
|
throw new BuildingQueueFullError(
|
||||||
|
task.id,
|
||||||
remainingSeconds + 1,
|
remainingSeconds + 1,
|
||||||
'Building queue is full'
|
'Building queue is full'
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,11 @@ export class UpgradeBuildingAction extends ActionController {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (btn.length !== 1) {
|
if (btn.length !== 1) {
|
||||||
throw new TryLaterError(5 * 60, 'No upgrade button, try later');
|
throw new TryLaterError(
|
||||||
|
task.id,
|
||||||
|
15 * 60,
|
||||||
|
'No upgrade button, try later'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
btn.trigger('click');
|
btn.trigger('click');
|
||||||
|
@ -21,7 +21,8 @@ export class AbortTaskError extends Error {
|
|||||||
export class TryLaterError extends Error {
|
export class TryLaterError extends Error {
|
||||||
readonly seconds: number;
|
readonly seconds: number;
|
||||||
readonly taskId: TaskId;
|
readonly taskId: TaskId;
|
||||||
constructor(seconds: number, taskId: TaskId, msg: string = '') {
|
|
||||||
|
constructor(taskId: TaskId, seconds: number, msg: string = '') {
|
||||||
super(msg);
|
super(msg);
|
||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
this.seconds = seconds;
|
this.seconds = seconds;
|
||||||
@ -32,7 +33,8 @@ export class TryLaterError extends Error {
|
|||||||
export class BuildingQueueFullError extends Error {
|
export class BuildingQueueFullError extends Error {
|
||||||
readonly seconds: number;
|
readonly seconds: number;
|
||||||
readonly taskId: TaskId;
|
readonly taskId: TaskId;
|
||||||
constructor(seconds: number, taskId: TaskId, msg: string = '') {
|
|
||||||
|
constructor(taskId: TaskId, seconds: number, msg: string = '') {
|
||||||
super(msg);
|
super(msg);
|
||||||
this.taskId = taskId;
|
this.taskId = taskId;
|
||||||
this.seconds = seconds;
|
this.seconds = seconds;
|
||||||
|
Loading…
Reference in New Issue
Block a user