diff --git a/maxun-core/src/interpret.ts b/maxun-core/src/interpret.ts index c2528f74..82f8dc3c 100644 --- a/maxun-core/src/interpret.ts +++ b/maxun-core/src/interpret.ts @@ -3222,8 +3222,11 @@ export default class Interpreter extends EventEmitter { * for the `{$param: nameofparam}` fields. */ public async run(page: Page, params?: ParamType): Promise { - this.log('Starting the workflow.', Level.LOG); + if (this.stopper) { + throw new Error('This Interpreter is already running a workflow. To run another workflow, please, spawn another Interpreter.'); + } this.isAborted = false; + this.log('Starting the workflow.', Level.LOG); const context = page.context(); page.setDefaultNavigationTimeout(100000); @@ -3239,9 +3242,6 @@ export default class Interpreter extends EventEmitter { this.log(`Proxy authenticated...`); } } - if (this.stopper) { - throw new Error('This Interpreter is already running a workflow. To run another workflow, please, spawn another Interpreter.'); - } /** * `this.workflow` with the parameters initialized. */