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