feat: specify robot name and error message

This commit is contained in:
Rohit
2025-05-27 23:46:56 +05:30
parent c47640dcda
commit 0aae146c6d

View File

@@ -255,17 +255,20 @@ async function executeRun(id: string, userId: string) {
finishedAt: new Date().toLocaleString(),
});
const recording = await Robot.findOne({ where: { 'recording_meta.id': run.robotMetaId }, raw: true });
// Trigger webhooks for run failure
const failedWebhookPayload = {
robot_id: run.robotMetaId,
run_id: run.runId,
robot_name: 'Unknown Robot',
robot_name: recording ? recording.recording_meta.name : 'Unknown Robot',
status: 'failed',
started_at: run.startedAt,
finished_at: new Date().toLocaleString(),
error: {
message: "Failed: Recording not found",
type: 'RecodingNotFoundError'
message: error.message,
stack: error.stack,
type: error.name || 'ExecutionError'
},
metadata: {
browser_id: run.browserId,