[9.0] [Console] Fix output when HTTP request to server fails (#219073)#219439
Merged
ElenaStoeva merged 1 commit intoelastic:9.0from Apr 30, 2025
Merged
[9.0] [Console] Fix output when HTTP request to server fails (#219073)#219439ElenaStoeva merged 1 commit intoelastic:9.0from
ElenaStoeva merged 1 commit intoelastic:9.0from
Conversation
Follow-up to elastic#218104 (comment) ## Summary This PR fixes the Console output when the HTTP request to the server fails with a non-empty error body. In elastic#218104, we incorrectly set the output to be `Request failed to get to the server (status code: ' + statusCode + ')` even if there is an error body. In this PR, we make sure to display the error body if it's non-empty. **How to test:** Send a request that fails and verify that the error body is displayed: ``` POST kbn:/api/alerting/rule/3603c386-9102-4c74-800d-2242e52bec98 { "name": "Alert on status change", "rule_type_id": ".es-querya" } ``` <img width="1160" alt="Screenshot 2025-04-24 at 14 41 57" src="https://github.com/user-attachments/assets/ced78171-4924-477f-ba2f-d5812bff1678" /> (cherry picked from commit cb0acc1) # Conflicts: # src/platform/plugins/shared/console/public/application/hooks/use_send_current_request/send_request.ts
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
mattkime
approved these changes
Apr 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.0:Questions ?
Please refer to the Backport tool documentation