-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Cleaner mechanism for handling custom errors #193
Comments
You could try pulling out a validate query strings method. If it fails validation build the error object from the message. If it passes, you only need to go down a happy path. |
This is harder than I thought, because the Lines 200 to 216 in 0abd3ab
|
I can clean this up further with the mechanism I'm using for #184 |
This code is pretty messy:
datasette/datasette/app.py
Lines 245 to 265 in 0abd3ab
Instead, it would be nice if I could raise an exception that would be converted into the appropriate JSON or HTML error message, with a corresponding HTTP code.
The text was updated successfully, but these errors were encountered: