Improve AI subscribe error handling for resolve this vulnerability
What does this MR do and why?
This catch error for the Apollo subscribe has been impossible to test > #432818 (comment 1689379115). It could be an Error
object or not. And looking at our codebase, there isn't a consistent way of handling this. Because of these reasons, I've updated the error handling to capture a wider range of error types.
// A. If it's indeed an Error object
e.message
// B. Else
e.toString
Alternatively, I've seen this done for ai_actions_dropdown.vue and ai_summary.vue. But ultimately decided against that since a more detailed output might be more beneficial.
// B. Else
'Something went wrong'
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Related to #432818 (closed)