Skip to content

Commit

Permalink
[Nu-7476] Add more info about failed deployment due to wrong cron con…
Browse files Browse the repository at this point in the history
…figuration (#7479)

* [Nu-7476] Add more info about failed deployment due to cron miss-configuration

---------

Co-authored-by: Piotr Rudnicki <[email protected]>
Co-authored-by: Dawid Poliszak <[email protected]>
  • Loading branch information
3 people committed Jan 22, 2025
1 parent 35c03d5 commit d4beb87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions designer/client/src/http/HttpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,13 @@ class HttpService {
.then(() => {
return { isSuccess: true };
})
.catch((error) => {
.catch((error: AxiosError) => {
if (error?.response?.status != 400) {
return this.#addError(
i18next.t("notification.error.failedToDeploy", "Failed to deploy {{processName}}", { processName }),
i18next.t("notification.error.failedToDeploy", "Failed to deploy {{processName}} due to: {{axiosError}}", {
processName,
axiosError: handleAxiosError(error),
}),
error,
true,
).then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ class PeriodicProcessService(
case e: SingleScheduleProperty => e.nextRunAt(clock).map(t => List((ScheduleName(None), t)))
}
(schedules match {
case Left(error) => Left(s"Failed to parse periodic property: $error")
case Right(scheduleDates) if scheduleDates.forall(_._2.isEmpty) => Left(s"No future date determined by $schedule")
case correctSchedules => correctSchedules
case Left(error) => Left(s"Problem with parsing periodic property: $error")
case Right(scheduleDates) if scheduleDates.forall(_._2.isEmpty) =>
Left(
s"Problem with the scheduled date. It seems that a date from the past was configured in the CRON configuration."
)
case correctSchedules => correctSchedules
}).left.map(new PeriodicProcessException(_))
}

Expand Down

0 comments on commit d4beb87

Please sign in to comment.