-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add support for full and partial call stacks, improved error handling in DashR #87
Conversation
Nice, that's certainly an improvement!
Does that work now? What does it look like? Also, am I reading it right that it's returning code 200 in the new version? Can we change it back to 500 (which is also what dash-py uses for errors)? |
😌
Not yet, but I think we're close. Right, 500 would make more sense. For HTML version of the call stack, I'll need to emulate what Any hints you can offer there would be much appreciated 🙂. I think the frontend code that handles this sort of thing is here: |
Also, it looks like Carson raised a related issue with Thomas Lin Pedersen, but I don't think it went anywhere: |
I think all you need is to send back the error as |
@@ -255,6 +254,9 @@ Dash <- R6::R6Class( | |||
} | |||
} | |||
|
|||
# set the callback context associated with this invocation of the callback | |||
private$callback_context_ <- setCallbackContext(request$body) |
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.
This looks great. I think all you need to do to finish off the callback context part of this PR is set it back to NULL
after the do.call
below, and have callback_context
throw an error if it finds NULL
.
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.
fixed in 6fc1cac
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.
Oh sorry - what I meant was, down here when you access callback_context_
https://github.com/plotly/dashR/pull/87/files#diff-1881af3720f8f49fd3a44e51c9fb5a0dR489
At that point, if it's NULL
, that means you're not in a callback so you shouldn't be able to access it, so throw an error.
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.
fixed in 96e4672
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.
💃 💃 💃
fixed in cee5376 |
This PR proposes multiple improvements to error handling and debugging in DashR:
debug
mode to DashR appsapp$run_server(debug=TRUE)
dash-renderer
and the recently released in-browser dev toolsHere is an example of an error before the proposed changes:
...and after:
Eventually, it should also be possible to conditionally implement line number support for R code loaded via
source()
.Closes #16 and #86.