Improve logs in workflow trigger (#12215)
- distinguish logs coming from webhook and job triggers - add workspace and workflow ids to help debugging Hard to debug sentry issue: https://twenty-v7.sentry.io/issues/6605607134/?project=4507072499810304&query=&referrer=issue-stream&stream_index=7
This commit is contained in:
@ -52,14 +52,14 @@ export class WorkflowTriggerJob {
|
||||
|
||||
if (!workflow) {
|
||||
throw new WorkflowTriggerException(
|
||||
'Workflow not found',
|
||||
`Workflow ${data.workflowId} not found in workspace ${data.workspaceId}`,
|
||||
WorkflowTriggerExceptionCode.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
|
||||
if (!workflow.lastPublishedVersionId) {
|
||||
throw new WorkflowTriggerException(
|
||||
'Workflow has no published version',
|
||||
`Workflow ${data.workflowId} has no published version in workspace ${data.workspaceId}`,
|
||||
WorkflowTriggerExceptionCode.INTERNAL_ERROR,
|
||||
);
|
||||
}
|
||||
@ -75,13 +75,13 @@ export class WorkflowTriggerJob {
|
||||
|
||||
if (!workflowVersion) {
|
||||
throw new WorkflowTriggerException(
|
||||
'Workflow version not found',
|
||||
`Workflow version ${workflow.lastPublishedVersionId} not found in workspace ${data.workspaceId}`,
|
||||
WorkflowTriggerExceptionCode.NOT_FOUND,
|
||||
);
|
||||
}
|
||||
if (workflowVersion.status !== WorkflowVersionStatus.ACTIVE) {
|
||||
throw new WorkflowTriggerException(
|
||||
'Workflow version is not active',
|
||||
`Workflow version ${workflowVersion.id} is not active in workspace ${data.workspaceId}`,
|
||||
WorkflowTriggerExceptionCode.INTERNAL_ERROR,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user