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

[Bug] Raw HTTP error response displayed when uploading actions fail #1120

Closed
Tracked by #1068
andrewazores opened this issue Sep 28, 2023 · 1 comment · Fixed by #1192
Closed
Tracked by #1068

[Bug] Raw HTTP error response displayed when uploading actions fail #1120

andrewazores opened this issue Sep 28, 2023 · 1 comment · Fixed by #1192
Assignees
Labels
bug Something isn't working

Comments

@andrewazores
Copy link
Member

andrewazores commented Sep 28, 2023

Current Behavior

When ex. uploading a JMX SSL cert, if the upload fails for any reason, the notification popup displayed shows the raw HTTP response JSON payload.

Expected Behavior

The error message should be nicely formatted, and more concise/informative.

Steps To Reproduce

  1. run smoketest.sh
  2. go to Security view
  3. try to upload an SSL cert more than once, ex. https://github.com/andrewazores/vertx-fib-demo/blob/master/src/main/extras/app/resources/vertx-fib-demo.cer
  4. go to Automated Rules
  5. create a rule
  6. download the rule
  7. delete the rule
  8. try to upload the same rule twice

Environment

No response

Anything else?

image

image

@andrewazores andrewazores added the bug Something isn't working label Sep 28, 2023
@andrewazores andrewazores self-assigned this Sep 28, 2023
@andrewazores andrewazores changed the title [Bug] Error message displayed when uploading duplicate JMX SSL cert is raw HTTP response [Bug] Raw HTTP error response displayed when uploading actions fail Sep 28, 2023
@andrewazores andrewazores removed their assignment Sep 28, 2023
@andrewazores andrewazores moved this to Backlog in 2.4.0 release Sep 28, 2023
@andrewazores andrewazores moved this from Backlog to Stretch Goals in 2.4.0 release Sep 28, 2023
@andrewazores
Copy link
Member Author

Upload requests go through here:

private sendLegacyRequest(

Error handling happens here:

this.notifications.danger(`Request failed (${error.xmlHttpResponse.status} ${error.message})`, detail);

Since this is not a WebSocket notification like most other graphical notifications that appear, we would need callers to pass in more details for notifications like the title that should appear on the notification. We could try to parse the detail body as JSON and use the detail.data.reason as the message to display, and if that fails simply show detail directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Stretch Goals
Development

Successfully merging a pull request may close this issue.

2 participants