-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Obs AI Assistant] Handle Axios errors correctly #186790
[Obs AI Assistant] Handle Axios errors correctly #186790
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
HistoryTo update your PR or re-run it, just comment with: cc @dgieselaar |
} | ||
|
||
delete sanitizedError.stack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I have an aversion against delete
and prefer explicitly picking the properties we expect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be omit
in that case (no way for us to account for all the possible properties of this object). In this case I prefer delete
ing properties of an object that is created a few lines up over having to re-assign stuff because of omit
/pick
.
the `kibana` function throws an axios error, and it resulted in an error because `toJSON()` doesn't actually return a string like I expected it to, it returns a structured object that can be converted into a string by calling JSON.stringify(). (cherry picked from commit ca41e66)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…86865) # Backport This will backport the following commits from `main` to `8.14`: - [[Obs AI Assistant] Handle Axios errors correctly (#186790)](#186790) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dario Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2024-06-25T06:38:22Z","message":"[Obs AI Assistant] Handle Axios errors correctly (#186790)\n\nthe `kibana` function throws an axios error, and it resulted in an error\r\nbecause `toJSON()` doesn't actually return a string like I expected it\r\nto, it returns a structured object that can be converted into a string\r\nby calling JSON.stringify().","sha":"ca41e6685ea245ea8d7fb3f39b31fa18f5134821","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Obs AI Assistant","ci:project-deploy-observability","v8.15.0","v8.14.2"],"title":"[Obs AI Assistant] Handle Axios errors correctly","number":186790,"url":"#186790 AI Assistant] Handle Axios errors correctly (#186790)\n\nthe `kibana` function throws an axios error, and it resulted in an error\r\nbecause `toJSON()` doesn't actually return a string like I expected it\r\nto, it returns a structured object that can be converted into a string\r\nby calling JSON.stringify().","sha":"ca41e6685ea245ea8d7fb3f39b31fa18f5134821"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#186790 AI Assistant] Handle Axios errors correctly (#186790)\n\nthe `kibana` function throws an axios error, and it resulted in an error\r\nbecause `toJSON()` doesn't actually return a string like I expected it\r\nto, it returns a structured object that can be converted into a string\r\nby calling JSON.stringify().","sha":"ca41e6685ea245ea8d7fb3f39b31fa18f5134821"}},{"branch":"8.14","label":"v8.14.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
the
kibana
function throws an axios error, and it resulted in an error becausetoJSON()
doesn't actually return a string like I expected it to, it returns a structured object that can be converted into a string by calling JSON.stringify().