-
Notifications
You must be signed in to change notification settings - Fork 131
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
JSONErrorsMixin not returning correct results after Notebook 5.2.0 is installed #262
Comments
kevin-bates
added a commit
to kevin-bates/kernel_gateway
that referenced
this issue
Oct 18, 2017
After Notebook 5.2.0 is installed, JSONErrorsMixin.write_error is used to convert errors into JSON responses. Previously, Notebook's `@json_errors` decorator performed this action. Since the decorator's replacement, `APIHandler.write_error`, doesn't adequately set the `reason` field, other tests fail so its not sufficient to drop the use of JSONErrorsMixin. As a result, JSONErrorsMixin now incorporates the appropriate code from `APIHandler.write_error` (in particular the setting of the `traceback` field) - in addition to appropriately setting the `reason` field. This mixin should continue to be used in the handler class hierachy until `APIHandler` is fixed. I have tested these changes with Notebook 5.1.0 and 5.2.0 installed.
parente
added a commit
that referenced
this issue
Oct 31, 2017
Fix #262: JSONErrorsMixin not returning correct results
parente
pushed a commit
that referenced
this issue
Nov 11, 2017
After Notebook 5.2.0 is installed, JSONErrorsMixin.write_error is used to convert errors into JSON responses. Previously, Notebook's `@json_errors` decorator performed this action. Since the decorator's replacement, `APIHandler.write_error`, doesn't adequately set the `reason` field, other tests fail so its not sufficient to drop the use of JSONErrorsMixin. As a result, JSONErrorsMixin now incorporates the appropriate code from `APIHandler.write_error` (in particular the setting of the `traceback` field) - in addition to appropriately setting the `reason` field. This mixin should continue to be used in the handler class hierachy until `APIHandler` is fixed. I have tested these changes with Notebook 5.1.0 and 5.2.0 installed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is related to Notebook Issue 2942.
One of the changes in Notebook 5.2.0 was the removal of the
@json_errors
decorator via PR 2853. Instead, much of the equivalent code was moved into theAPIHandler.write_error
method. However, by virtue of the decorator's removal and the inheritance hierarchy, theJSONErrorsMixin.write_error
method is called instead ofAPIHandler.write_error
.JSONErrorsMixin.write_error
doesn't handle the traceback functionality present in@json_errors
(orAPIHandler
) and results in the breakage of theTestCustomDefaultKernel
test.Since
APIHandler.write_error
should be doing the equivalent of@json_errors
, I commented out the subclassing ofJSONErrorsMixin
from some of the handler classes, but then encountered a different set of test errors - these relating to noreason
field on HTTP errors. It turns out that one of the pieces of functionality in@json_errors
not "transferred" toAPIHandler
was the appropriate setting of the reason code.Since its not sufficient to fallback to using
APIHandler
, we should make the appropriate changes toJSONErrorsMixin.write_error
in order to bridge the gap between Notebook 5.2 GA and the future release that addresses the APIHandler/reason issue.The text was updated successfully, but these errors were encountered: