{"record":{"id":"e0ddee75b98ae60a","repo":"twentyhq/twenty","slug":"failed-to-describe-cron-expression-errormessage","errorCode":null,"errorMessage":"Failed to describe cron expression: ${errorMessage}","messagePattern":"Failed to describe cron expression: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-front/src/modules/workflow/workflow-trigger/utils/cron-to-human/describeCronExpression.ts","lineNumber":114,"sourceCode":"    }\n    const monthsDesc = getMonthsDescription(\n      parts.month,\n      mergedOptions,\n      localeCatalog,\n    );\n    if (isDefined(monthsDesc) && monthsDesc !== '') {\n      descriptions.push(monthsDesc);\n    }\n\n    if (descriptions.length === 0) {\n      return t`every minute`;\n    }\n    // Simple joining - just use spaces, no commas for cleaner descriptions\n    return descriptions.join(' ');\n  } catch (error) {\n    const errorMessage =\n      error instanceof Error ? error.message : 'Unknown error';\n    throw new Error(`Failed to describe cron expression: ${errorMessage}`);\n  }\n};\n","sourceCodeStart":96,"sourceCodeEnd":117,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-front/src/modules/workflow/workflow-trigger/utils/cron-to-human/describeCronExpression.ts#L96-L117","documentation":"Top-level catch-all wrapper in describeCronExpression: any error thrown inside the try block (most commonly from parseCronExpression) is re-thrown with the prefix 'Failed to describe cron expression: ' plus the inner error message. This is the error users see for malformed cron input.","triggerScenarios":"parseCronExpression throws (invalid field count, cron-parser rejects out-of-range values like minute 99). A descriptor helper throws on unsupported syntax. Any non-Error throw produces 'Unknown error'.","commonSituations":"User types an invalid cron expression in the workflow schedule editor (e.g., '99 99 * * *', '*/5 / / * *', too many fields). Out-of-range or non-numeric field values.","solutions":["Read the suffixed inner message to identify which validation failed (field count vs cron-parser range error).","Correct the cron expression to valid 5-field syntax with in-range values.","If surfacing to users, strip the 'Failed to describe cron expression: ' prefix and show only the inner reason."],"exampleFix":"// before: cron '99 99 * * *'  -> 'Failed to describe cron expression: Invalid cron expression: ...'\n// after:  cron '0 9 * * *'   -> 'at 09:00'","handlingStrategy":"try-catch","validationCode":"const tryDescribeCron = (expr: string): string => {\n  try { return describeCronExpression(expr); }\n  catch (e) { return ''; }\n};","typeGuard":"const isValidCron = (expr: string): boolean => {\n  try { parseCronExpression(expr); return true; } catch { return false; }\n};","tryCatchPattern":"try {\n  const human = describeCronExpression(expr);\n} catch (e) {\n  // strip the wrapper prefix to show only the inner reason\n  const inner = (e as Error).message.replace(/^Failed to describe cron expression: /, '');\n  setScheduleError(inner);\n}","preventionTips":["Validate cron before letting the user save the schedule.","Provide a cron-picker UI that only emits valid 5-field expressions.","Surface the inner error message to users rather than the wrapper."],"tags":["cron","workflow","validation"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}