File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ import useStore from "@/store";
4949import { posthog } from " @/telemetry" ;
5050import { BuilderPage } from " @/types/Builder/BuilderPage" ;
5151import { Dialog } from " frappe-ui" ;
52- import { ref } from " vue" ;
52+ import { defineComponent , ref } from " vue" ;
5353import { toast } from " vue-sonner" ;
5454import CodeEditor from " ./CodeEditor.vue" ;
5555import PageClientScriptManager from " ./PageClientScriptManager.vue" ;
@@ -75,10 +75,15 @@ const savePageDataScript = (value: string) => {
7575 store .setPageData (props .page );
7676 toast .success (" Data script saved" );
7777 })
78- .catch ((e : { message: string ; exc: string }) => {
79- const error_message = e .exc .split (" \n " ).slice (- 2 )[0 ];
78+ .catch ((e : { message: string ; exc: string ; messages: [string ] }) => {
79+ let errorMessage = e .exc ?.split (" \n " ).slice (- 2 )[0 ];
80+ if (! errorMessage ) {
81+ errorMessage = e .messages [0 ];
82+ }
8083 toast .error (" Failed to save script" , {
81- description: error_message ,
84+ description: defineComponent ({
85+ template: ` <div>${errorMessage }</div> ` ,
86+ }),
8287 });
8388 });
8489};
You can’t perform that action at this time.
0 commit comments