prompt batch error
This commit is contained in:
1 parent
9264d0d28a
commit
5c57212a90
3 files changed
+11
No files matched your search
@@ -310,6 +310,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
||||
filters: [{ name: "Javascript", extensions: ["js"] }],
|
||||
})?.[0];
|
||||
if (scriptPath) {
|
||||
let hasError = false;
|
||||
try {
|
||||
console.log("run script", scriptPath);
|
||||
const str = fs.readFileSync(scriptPath, "utf8");
|
||||
@@ -332,8 +333,14 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
hasError = true;
|
||||
console.error(error);
|
||||
}
|
||||
if (hasError) {
|
||||
message.error(i18n.t("batchFailed"));
|
||||
} else {
|
||||
message.success(i18n.t("batchCompleted"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user