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

Answer descriptive error when requesting too high API version #7424

Merged
merged 4 commits into from
Nov 8, 2023

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Nov 6, 2023

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Requests a URI with higher API version

Issues:


(Please delete unneeded items, merge only when none are left open)

@frcroth frcroth changed the title Add error when requesting too high API version Answer descriptive error when requesting too high API version Nov 6, 2023
@frcroth frcroth requested a review from fm3 November 6, 2023 14:32
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Works well for me :)

Could this be rewritten to avoid the return? Compare #6356

I think it would be more readable and scala-esque to go with another if-else. You could also extract the handling of this case into a separate method to keep this if-else cascade clean.

I’d say it is fair to do two regex matchings if needed (one for the if/else and one in the extracted function to get the api version for the error message I guess)

@frcroth frcroth requested a review from fm3 November 8, 2023 08:37
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

🎉 :shipit:

@frcroth frcroth merged commit 88ede5b into master Nov 8, 2023
2 checks passed
@frcroth frcroth deleted the api-version-too-high branch November 8, 2023 09:28
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.

Create speaking error message when a route with a too-new api version is requested
2 participants