-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Ensure that the original error gets preserved by the ErrorModule #4
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -335,9 +335,8 @@ def can_execute_unsafe_code(): | |
| else: | ||
| err_descriptor_class = NonStaffErrorDescriptor | ||
|
|
||
| err_descriptor = err_descriptor_class.from_xml( | ||
| str(descriptor), descriptor.system, | ||
| org=descriptor.location.org, course=descriptor.location.course, | ||
| err_descriptor = err_descriptor_class.from_descriptor( | ||
| descriptor, | ||
| error_msg=exc_info_to_str(sys.exc_info()) | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the methods, doesn't look quite equivalent. In particular, the preceding approach results in a bogus location. Don't know if that's desirable -- it might be an improvement to actually store the original location, but it might also break things if the location is used to then find the corresponding descriptor, and yields the original instead of none. I'm willing to gamble on that. But using the from_descriptor ends up using descriptor._model_data instead of str(descriptor). Any idea how different those are?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only difference is that the descriptor dumps the location and the module type, as far as I can tell, at least for capa problems and videos. It is useful to have the location show up in the error message, I agree, but maybe the raw data section is not the best place for it. I'll talk to @shnayder about what we really want this to do.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there integration tests for this line? I thought we had some, but I can't seem to find them. The place for these would be in
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should we expect to be included in the rendered html? A generic error message? If so, we should assert so explicitly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with that is that the current test system renderer just spits back out the original context. What do you recommend that I do? Change it to render using mitxmako?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, that makes sense. Thanks for the explanation.