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
Better Error Reporting #259
Comments
Looks good to me, care to make PR? |
Sure, can I suggest another improvement too. I currently have a problem where I get an exception in a I'd like to add a Null logger to the |
Also, I noticed that in the import.html template we show the traceback for row errors but not for base errors. I'd like to correct that, unless there was a specific reason for not showing them. |
fwiw, with the exception logging place, the test output now looks like:
I.e. the tests all run successfully but the errors get logged to the console. Is that OK? |
I can suppress the exception logging when running tests by adding to LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'console': {
'class': 'logging.NullHandler'
}
},
'root': {
'handlers': ['console'],
}} |
Please add some comment here when this code is released, it should help me a lot. Maybe add a "released" label? |
At the moment, when an error occurs with
raise_errors = False
we store the traceback and the error message and show it to the user.However, we don't show the actual data in the row that caused the error, which makes it hard to troubleshoot what went wrong. This is particularly true if the dataset has been manipulated in
before_import
; for example, I have a lot of imports where I have to un-crosstab an Excel spreadsheet before importing it, so the rows in the dataset don't match the rows in the spreadsheet.One simple solution is to allow the
results.Error
class to store therow
:And then for
import_data
to save it:And then finally for the template to display it:
This works for me without any special effort to coerce the
row
to a string. I get output like:That output is much more useful to me than the default.
The text was updated successfully, but these errors were encountered: