Skip to content

Commit

Permalink
More graceful cron parse error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AFaust authored and yregaieg committed May 11, 2020
1 parent db48fd1 commit dd771bf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Job Group
scheduled-jobs.table-header.job-state=State
scheduled-jobs.table-header.job-state-title=Job State
scheduled-jobs.table-header.cron-expression=Cron Expression
scheduled-jobs.table-header.cron-expression.unparseable=The expression {0} is invalid and cannot be parsed to a human readable representation
scheduled-jobs.table-header.start-time=Start Time
scheduled-jobs.table-header.previous-fire-time=Previous Fire Time
scheduled-jobs.table-header.next-fire-time=Next Fire Time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Gruppe der Aufgabe
scheduled-jobs.table-header.job-state=Status
scheduled-jobs.table-header.job-state-title=Status der Aufgabe
scheduled-jobs.table-header.cron-expression=CRON-Ausdruck
scheduled-jobs.table-header.cron-expression.unparseable=Der CRON-Ausdruck {0} ist ung\u00fcltig und kann nicht in natursprachlicher Form dargestellt werden
scheduled-jobs.table-header.start-time=Startzeit
scheduled-jobs.table-header.previous-fire-time=Letzte Ausl\u00f6sung
scheduled-jobs.table-header.next-fire-time=N\u00e4chste Ausl\u00f6sung
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Job Group
scheduled-jobs.table-header.job-state=State
scheduled-jobs.table-header.job-state-title=Job State
scheduled-jobs.table-header.cron-expression=Cron Expression
scheduled-jobs.table-header.cron-expression.unparseable=The expression {0} is invalid and cannot be parsed to a human readable representation
scheduled-jobs.table-header.start-time=Start Time
scheduled-jobs.table-header.previous-fire-time=Previous Fire Time
scheduled-jobs.table-header.next-fire-time=Next Fire Time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Job Group
scheduled-jobs.table-header.job-state=Estado
scheduled-jobs.table-header.job-state-title=Estado de la Tarea
scheduled-jobs.table-header.cron-expression=Expressi\u00f3n Cron
scheduled-jobs.table-header.cron-expression.unparseable=The expression {0} is invalid and cannot be parsed to a human readable representation
scheduled-jobs.table-header.start-time=Hora de inicio
scheduled-jobs.table-header.previous-fire-time=Ultima ejecuci\u00f3n
scheduled-jobs.table-header.next-fire-time=Pr\u00f3xima ejecuci\u00f3n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Job Group
scheduled-jobs.table-header.job-state = Stato
scheduled-jobs.table-header.job-state-title = Stato del lavoro
scheduled-jobs.table-header.cron-expression = espressione Cron
scheduled-jobs.table-header.cron-expression.unparseable=The expression {0} is invalid and cannot be parsed to a human readable representation
scheduled-jobs.table-header.start-time = Ora di inizio
scheduled-jobs.table-header.previous-fire-time = Tempo di fuoco precedente
scheduled-jobs.table-header.next-fire-time = Tempo di fuoco successivo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ scheduled-jobs.table-header.job-group-title=Grupo do Trabalho
scheduled-jobs.table-header.job-state=Situa\u00e7\u00e3o
scheduled-jobs.table-header.job-state-title=Situa\u00e7\u00e3o do Job
scheduled-jobs.table-header.cron-expression=Express\u00e3o Cron
scheduled-jobs.table-header.cron-expression.unparseable=The expression {0} is invalid and cannot be parsed to a human readable representation
scheduled-jobs.table-header.start-time=Hor\u00e1rio de In\u00edcio
scheduled-jobs.table-header.previous-fire-time=Hor\u00e1rio da Execu\u00e7\u00e3o Anterior
scheduled-jobs.table-header.next-fire-time=Hor\u00e1rio da Pr\u00f3xima Execu\u00e7\u00e3o
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,16 @@ function buildScheduledJobsData()
cronExpressionDescription = null;
if (cronExpression)
{
cronExpressionDescription = descriptor.describe(parser.parse(cronExpression));
try
{
cronExpressionDescription = descriptor.describe(parser.parse(cronExpression));
}
catch (e)
{
cronExpressionDescription = msg.get('scheduled-jobs.table-header.cron-expression.unparseable', [ cronExpression ]);
}
}

effectiveJobName = quartzMajorVersion === 1 ? jobTriggerDetail.jobName : jobTriggerDetail.jobKey.name;
effectiveJobGroupName = quartzMajorVersion === 1 ? jobTriggerDetail.jobGroup : jobTriggerDetail.jobKey.group;
jobTriggers.push({
Expand Down

0 comments on commit dd771bf

Please sign in to comment.