Skip to content

Commit 7cae9d5

Browse files
joshariansketch
andcommitted
webui: add JavaScript alert for file save failures
Now that Philip fixed #213, this should be safe to unleash on everyone. JavaScript alerts are ugly, but: - this shouldn't happen - if it does, the user should really know that their edits are in peril Co-Authored-By: sketch <hello@sketch.dev> Change-ID: s95d29aed61ef60f6k
1 parent e34ffd6 commit 7cae9d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

webui/src/web-components/sketch-diff2-view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export class SketchDiff2View extends SketchTailwindElement {
114114
console.log(`File saved: ${path}`);
115115
(monacoView as any).notifySaveComplete(true);
116116
} catch (error) {
117-
console.error(
118-
`Error saving file: ${error instanceof Error ? error.message : String(error)}`,
119-
);
117+
const errorMessage =
118+
error instanceof Error ? error.message : String(error);
119+
alert(`Failed to save changes to ${path}:\n\n${errorMessage}`);
120120
(monacoView as any).notifySaveComplete(false);
121121
}
122122
} catch (error) {

0 commit comments

Comments
 (0)