Skip to content

Commit

Permalink
Merge pull request #40 from 10clouds/eslint-rules-upgrade
Browse files Browse the repository at this point in the history
Eslint rules upgrade
  • Loading branch information
maciejt10c authored Oct 10, 2023
2 parents 8980d19 + 0419de1 commit c9f5bd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/tasks/mutators/mutateEndStage.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TaskContext } from '../TaskContext';
import { TaskCanceled } from '../utils/TaskCanceled';
import { TaskCanceledError } from '../utils/TaskCanceled';

export function mutateEndStage(task: TaskContext) {
if (task.stopped) {
throw new TaskCanceled();
throw new TaskCanceledError();
}

task.progress = task.stageTargetProgress;
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/mutators/mutateRunTaskStages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { WorkspaceFilesKnowledge } from '../../minionTasks/generateDescriptionFo
import { calculateAndFormatExecutionTime } from '../../utils/calculateAndFormatExecutionTime';
import { mutateAppendToLog } from '../logs/mutators/mutateAppendToLog';
import { TaskContext } from '../TaskContext';
import { TaskCanceled } from '../utils/TaskCanceled';
import { TaskCanceledError } from '../utils/TaskCanceled';
import { mutateStopExecution } from './mutateStopExecution';

export function mutateRunTaskStages<TC extends TaskContext>(
Expand All @@ -29,7 +29,7 @@ export function mutateRunTaskStages<TC extends TaskContext>(
execute(task, getExternalData, test);
mutateStopExecution(task);
} catch (error) {
if (!(error instanceof TaskCanceled)) {
if (!(error instanceof TaskCanceledError)) {
getEditorManager().showErrorMessage(`Error in execution: ${error}`);
console.error('Error in execution', error);
}
Expand Down
3 changes: 2 additions & 1 deletion src/tasks/utils/TaskCanceled.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { CANCELED_STAGE_NAME } from '../stageNames';

export class TaskCanceled extends Error {
export class TaskCanceledError extends Error {
constructor() {
super(CANCELED_STAGE_NAME);
this.name = 'TaskCanceledError';
}
}

0 comments on commit c9f5bd6

Please sign in to comment.