Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observation/FOUR-19985: Improvement, AI assistant Scripts improvement in the response message of the prompt without a description. #7688

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions resources/js/processes/scripts/components/AiTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,15 @@ export default {
this.$emit("request-started", this.progress, this.$t("Generating"));
}
})
.catch(() => {
const errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
.catch((error) => {
let errorMsg;
if (error.response && error.response.data && error.response.data.message) {
errorMsg = error.response.data.message;
} else if (error.message) {
errorMsg = error.message;
} else {
errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
}
window.ProcessMaker.alert(errorMsg, "danger");
});
},
Expand Down Expand Up @@ -353,8 +360,15 @@ export default {
this.$emit("request-started", this.progress, this.$t("Cleaning"));
}
})
.catch(() => {
const errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
.catch((error) => {
let errorMsg;
if (error.response && error.response.data && error.response.data.message) {
errorMsg = error.response.data.message;
} else if (error.message) {
errorMsg = error.message;
} else {
errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
}
window.ProcessMaker.alert(errorMsg, "danger");
});
},
Expand Down Expand Up @@ -396,8 +410,15 @@ export default {
);
}
})
.catch(() => {
const errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
.catch((error) => {
let errorMsg;
if (error.response && error.response.data && error.response.data.message) {
errorMsg = error.response.data.message;
} else if (error.message) {
errorMsg = error.message;
} else {
errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
}
window.ProcessMaker.alert(errorMsg, "danger");
});
},
Expand Down Expand Up @@ -438,8 +459,15 @@ export default {
);
}
})
.catch(() => {
const errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
.catch((error) => {
let errorMsg;
if (error.response && error.response.data && error.response.data.message) {
errorMsg = error.response.data.message;
} else if (error.message) {
errorMsg = error.message;
} else {
errorMsg = this.$t("ProcessMaker AI is currently offline. Please try again later.");
}
window.ProcessMaker.alert(errorMsg, "danger");
});
},
Expand Down
Loading