Skip to content

Commit cf0b661

Browse files
committed
bug: error handling
1 parent 8406247 commit cf0b661

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎frontend/src/pages/CreateProject.jsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ function CreateProject() {
5757
setNewProject(res.data);
5858
toast.success("Project Created!");
5959
} catch (err) {
60-
toast.error(err.response?.data || "Failed to create project");
60+
const errorMsg = err.response?.data?.error || err.response?.data?.message || "Failed to create project";
61+
toast.error(typeof errorMsg === 'object' ? "Validation Error" : errorMsg);
6162
} finally {
6263
setLoading(false);
6364
}

0 commit comments

Comments
 (0)