diff --git a/server/src/api/record.ts b/server/src/api/record.ts index 578760a6..4fd4f2bd 100644 --- a/server/src/api/record.ts +++ b/server/src/api/record.ts @@ -245,23 +245,25 @@ async function createWorkflowAndStoreMetadata(id: string, userId: string) { async function readyForRunHandler(browserId: string, id: string) { try { - const interpretation = await executeRun(id); + const result = await executeRun(id); - if (interpretation) { + if (result && result.success) { logger.log('info', `Interpretation of ${id} succeeded`); + return result.interpretationInfo; } else { logger.log('error', `Interpretation of ${id} failed`); await destroyRemoteBrowser(browserId); + return null; } - resetRecordingState(browserId, id); - } catch (error: any) { logger.error(`Error during readyForRunHandler: ${error.message}`); await destroyRemoteBrowser(browserId); + return null; } } + function resetRecordingState(browserId: string, id: string) { browserId = ''; id = '';