convert user objects to unicode, improve error logging - #424
Conversation
There was a problem hiding this comment.
I'd like to see the error message appearing in the msg as well. I think the rescore code below does that.
There was a problem hiding this comment.
Do we really have anything to report here? Not clear that the error message is different (or nicer) than the original one.
There was a problem hiding this comment.
Usually, you get the exception into a string with just: "Oh noes: {0}".format(err)
There was a problem hiding this comment.
The idea was that we'd just get more information to understand what went wrong
There was a problem hiding this comment.
For future debugging
There was a problem hiding this comment.
But here nothing particularly went wrong, except user error. They typed in a urlname value that didn't find an existing module. It's not something that we should be logging, I don't think, and certainly not as an exception!
|
Ok, I'm seeing two criticisms here:
2 totally makes sense. That's my bad. My question is should we be logging any of these exceptions? Should we be displaying any of these errors to the instructor? |
There was a problem hiding this comment.
I still don't think we should be logging this exception. We know it's a DoesNotExist error, so logging the exception won't provide information, and it will create a lot of noise.
|
The original motivation was to see what the errors where when staff are trying to reset attempts. It was failing, but we didn't know why. So having that be reported, both on screen and in log files, would be useful. Same goes for the delete case. But not for the not-a-recognized-problem case. |
|
That makes a lot of sense. |
|
Does this look better? |
There was a problem hiding this comment.
What you have could be written more succinctly as msg += current_msg. I would prefer to have the error message appear in msg and not in the string passed to log.exception, so what I said before about message reuse was wrong.
|
Looks good. Just squash the commits and go ahead and merge. |
distinguish logged error and instructor-facing error
convert user objects to unicode, improve error logging
There were a couple of user objects that weren't being converted to unicode strings in instructor/views.
This was causing a bug where student answers appeared not to be reset.
@ichuang
@brianhw
addresses https://edx-wiki.atlassian.net/browse/LMS-693