Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: update
initialize
endpoint and createassessments/feedback
endpoint in ORA Staff Grader #33632feat: update
initialize
endpoint and createassessments/feedback
endpoint in ORA Staff Grader #33632Changes from all commits
7c0485e
945dd6e
8bbdaec
f9d671e
ecb3fe1
b006691
0dd2338
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@BryanttV I'm hitting this general Exception clause when I try accessing these endpoints as a student. Traceback below; is there a better way to catch xblock handler permission errors?
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.
Hi @pomegranited, I was doing some research and found the following:
Currently, this is how the other ORA Staff Grader endpoints behave.
The error is generated from the following line. When there is a permissions error from ORA the following is returned in the
response.content
:b'<div>You do not have permission to access ORA staff grading.</div>\n
When trying to parse this string to a dict using
json.loads()
it breaks 💥I think that this permission error should be raised by the
XBlockInternalError
, but since thestatus_code
of the response always returns a200
, the error would never be raised, even though it exists. In my opinion, if there is any type of error from the handler, the most appropriate thing to do is to return the corresponding4xx
code.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.
I see that also happens with the existing
initialize
endpoint. The views don't check for permissions, but it waits for the ORA handlers to return:So maybe it'd be enough to return this error, but avoiding the unknown error by wrapping
json.loads(response.content)
in a try-except block.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.
By doing this change:
The response looks like this:
And the log looks like this: