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 313. Unhandled response status codes in BaseEndpoint #459

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

MytsV
Copy link
Contributor

@MytsV MytsV commented Aug 15, 2024

Fixes #313

Moreover, it makes the message from the server be displayed correctly.

Before:
{"status":"error","id":"","name":"","rse_type":"UNKNOWN","volatile":false,"deterministic":false,"staging_area":false,"message":"The requested resource was not found at https://127.0.0.1:8081/rses/?expression=MOCK1. Error Details: [object Object]"}
image

After:
{"status":"error","id":"","name":"","rse_type":"UNKNOWN","volatile":false,"deterministic":false,"staging_area":false,"message":"The request had invalid syntax. Error Details: {\"ExceptionClass\":\"InvalidRSEExpression\",\"ExceptionMessage\":\"RSE Expression resulted in an empty set.\"}"}
image

P. S. I changed the BAD_REQUEST error message, but I undestand that it may sometimes signify that a resource wasn't found. Please let me know if that's okay

MytsV added 3 commits August 15, 2024 18:16
This makes all the other possible status codes cause the API page to return a valid JSON instead of HTML that may break the app
Copy link
Member

@maany maany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! good catch ;)

@maany maany added this to the 35.2.0 milestone Aug 15, 2024
@maany maany merged commit 20427b6 into rucio:master Aug 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled Exception when DIDMeta endpoint does not find DID
2 participants