Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1913] fix: handled error message for duplicate label (#5199)

Akshita Goyal66c2cbe7d644
diff --git a/web/core/components/issues/issue-detail/label/root.tsx b/web/core/components/issues/issue-detail/label/root.tsx
index 277bc8849d..afff6c0f6a 100644
--- a/web/core/components/issues/issue-detail/label/root.tsx
+++ b/web/core/components/issues/issue-detail/label/root.tsx
@@ -62,10 +62,14 @@ export const IssueLabel: FC<TIssueLabel> = observer((props) => {
});
return labelResponse;
} catch (error) {
+ let errMessage = "Label creation failed";
+ if (error && (error as any).error === "Label with the same name already exists in the project")
+ errMessage = "Label already exists";
+
setToast({
title: "Error!",
type: TOAST_TYPE.ERROR,
- message: "Label creation failed",
+ message: errMessage,
});
throw error;
}