From dcf3cfdbff85bbfba016d2d995a21403be36f94e Mon Sep 17 00:00:00 2001 From: Piotr Rudnicki Date: Mon, 20 Jan 2025 14:19:25 +0100 Subject: [PATCH] [Nu-7476] Add more info about failed deployment due to cron miss-configuration --- designer/client/src/devHelpers.ts | 6 +++++- designer/client/src/http/HttpService.ts | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/designer/client/src/devHelpers.ts b/designer/client/src/devHelpers.ts index 5790c328dd3..2b3480287fd 100644 --- a/designer/client/src/devHelpers.ts +++ b/designer/client/src/devHelpers.ts @@ -15,7 +15,11 @@ export function withLogs(fn: (...args: A) => R, message? export function handleAxiosError(error: AxiosError): string { if (error.response?.data && typeof error.response.data === "string") { - return error.response.data; + if (error.response.data.startsWith("No future date determined by CronScheduleProperty")) { + return i18next.t("errors.axiosError.scheduledCron", "problem with scheduled date"); + } else { + return error.response.data; + } } const httpStatusCode = error.response?.status; diff --git a/designer/client/src/http/HttpService.ts b/designer/client/src/http/HttpService.ts index 9fcf4cdadc6..3759f6fb9b4 100644 --- a/designer/client/src/http/HttpService.ts +++ b/designer/client/src/http/HttpService.ts @@ -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(() => {