Improve API error handling to show exact server error message on save failure

This commit is contained in:
AI Bot
2026-07-30 17:56:53 +05:30
parent a327106b19
commit f053f64533
2 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -677,9 +677,9 @@ export default function Editor() {
if (projectId === 'new' && result.id) {
navigate(`/editor/${result.id}`, { replace: true });
}
} catch (err) {
} catch (err: any) {
console.error("Failed to save project to cloud", err);
alert("Failed to save project");
alert("Failed to save project: " + (err.message || JSON.stringify(err)));
} finally {
setIsRendering(false);
setOpenMenu(null);