diff --git a/src/lib/chain-service.ts b/src/lib/chain-service.ts index 3a703a0..b6666c2 100644 --- a/src/lib/chain-service.ts +++ b/src/lib/chain-service.ts @@ -306,7 +306,12 @@ class ChainService { */ async cancelExecution(executionId: string): Promise { const execution = await this.getExecution(executionId); - if (!execution || execution.status !== 'running') return; + if (!execution) { + throw new Error(`Execution ${executionId} not found`); + } + if (execution.status !== 'running') { + throw new Error(`Cannot cancel execution with status: ${execution.status}`); + } execution.status = 'cancelled'; execution.completedAt = new Date();