mirror of
https://github.com/andwati/dokploy.git
synced 2026-12-01 07:28:45 +00:00
fix(application): simplify error message handling in deployment notifications
This commit is contained in:
@@ -238,20 +238,12 @@ export const deployApplication = async ({
|
|||||||
await updateDeploymentStatus(deployment.deploymentId, "error");
|
await updateDeploymentStatus(deployment.deploymentId, "error");
|
||||||
await updateApplicationStatus(applicationId, "error");
|
await updateApplicationStatus(applicationId, "error");
|
||||||
|
|
||||||
const errorMessage =
|
|
||||||
error instanceof Error
|
|
||||||
? error.message
|
|
||||||
: String(error) || "Error building";
|
|
||||||
// Truncate and sanitize error message for notifications
|
|
||||||
const sanitizedErrorMessage = errorMessage
|
|
||||||
.replace(/ghs_[a-zA-Z0-9]+/g, "ghs_***") // Hide GitHub tokens
|
|
||||||
.substring(0, 1500); // Truncate to avoid notification limits
|
|
||||||
|
|
||||||
await sendBuildErrorNotifications({
|
await sendBuildErrorNotifications({
|
||||||
projectName: application.project.name,
|
projectName: application.project.name,
|
||||||
applicationName: application.name,
|
applicationName: application.name,
|
||||||
applicationType: "application",
|
applicationType: "application",
|
||||||
errorMessage: sanitizedErrorMessage,
|
// @ts-ignore
|
||||||
|
errorMessage: error?.message || "Error building",
|
||||||
buildLink,
|
buildLink,
|
||||||
organizationId: application.project.organizationId,
|
organizationId: application.project.organizationId,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user