-
Notifications
You must be signed in to change notification settings - Fork 36
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
Improve formatting of back-end exceptions #3343
Comments
I believe this issue was not always the case. Some update (maybe the Django/Python update) or change in the code caused this problem. I have done some looking into this before: The middleware is properly returning nothing (None) when Debug mode is enabled specify7/specifyweb/middleware/general.py Line 45 in 393538b
So Django is sending its own error message to the frontend Perhaps changing the order in which Django handles the middleware will alleviate the problem (See the Django docs on Middleware layering) or maybe Django has since migrated the error message into another Middleware option (here is a list of all available Middleware) Currently, our Middleware is layered as: specify7/specifyweb/settings/__init__.py Lines 186 to 197 in 393538b
I will do some further investigation so we can get back to the Django responses! |
I have done further investigation into this issue and here is what I have found so far:
I think that Django is not sending proper HTML to the frontend, and rather sending formatted text (with tabs and new lines). I am unsure why Django is doing this suddenly, and have had little luck thus far finding similar experiences online. |
Could it be because front-end uses |
Yes, I'd say that's worth investigating! I will try and take a look and see if that is the issue soon. |
@melton-jason Take a look at this issue when you get a chance (no rush). |
Yes, this seems to be the issue.
|
Can recreate in edge (7.9.6) |
Back-end sends a stack trace properly formatted, but front-end glues all lines into one big mess. Need to wrap it in
<pre></pre>
to fix this. Better yet, @melton-jason is there a way to get back the original django exception page (when in development) - it was quite helpfulSee #3315 (review) for another example
The text was updated successfully, but these errors were encountered: