-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Better handling for user-defined error conditions in debug mode #116
Conversation
@alexcjohnson Any comments on this one? |
As discussed this morning, I'll implement a basic test which incorporates a |
fixed in 1029ec4 |
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.
💃
* Provide support for no_update in Dash for R (#111) * Use dev_tools_prune_errors instead of pruned_errors (#113) * Better handling for user-defined error conditions in debug mode (#116) * Provide support for multiple outputs (#119) * Provide support for hot reloading in Dash for R (#127) * Implement support for clientside callbacks in Dash for R (#130) * Add line number context to stack traces when srcrefs are available (#133) * Update dash-renderer to 1.2.2 and fix dev tools UI display of stack traces (#137) * Support for meta tags in Dash for R (#142) * Fixes for hot reloading interval handling and refreshing apps within viewer pane (#148) * Support for asynchronous loading/compression in Dash for R (#157) * Support returning asset URLs via public method within Dash class (#160) * Minor fix for get_asset_url + docs, add url_base_pathname (#161)
As noted in #115,
getStackTrace
behaves a bit unexpectedly when a user defined error is encountered within a callback while in debug mode, e.g.ought to produce the following console text while sending a traceback up to the dev tools UI:
However, the traceback was not provided previously in such cases, and a JS error could be thrown in the browser instead, halting app execution.
This PR proposes to address the problem by introducing conditional logic to identify calls of class
simpleError
, and to deparse the calls so that they may be treated as strings when constructing thestack_message
object.The problem is that
stop
is asymbol
in R, and attempting to naively treat it as a string may throw the following error:which can prevent the traceback from being returned. The key additions are
dashR/R/utils.R
Lines 698 to 707 in b170cfa
dashR/R/utils.R
Lines 738 to 747 in b170cfa
dashR/R/utils.R
Lines 762 to 770 in b170cfa
Closes #115.