Skip to content
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

Fix debug mode warning output display #220

Merged
merged 5 commits into from
Jul 31, 2020
Merged

Fix debug mode warning output display #220

merged 5 commits into from
Jul 31, 2020

Conversation

strboul
Copy link
Contributor

@strboul strboul commented Jul 30, 2020

I very much appreciate that the errors are caught as warnings in debug mode so they don't crash the running application, but it was annoying that I couldn't see where the user-defined errors occurred.

There was a bug in the indexFromLast object returning NA.

Test application
library(dash)
library(dashHtmlComponents)
library(dashCoreComponents)

app <- Dash$new()

app$layout(
  htmlDiv(
    list(
      dccInput(id = "inputID", value = "initial value", type = "text"),
      htmlDiv(id = "outputID")
    )
  )
)

fun <- function() {
  stop("this is an error message")
}

app$callback(
  output = list(id = "outputID", property = "children"),
  params = list(
    input(id = "inputID", property = "value"),
    state(id = "inputID", property = "type")
  ), function(x, y) {
    fun()
    sprintf("You've entered: '%s' into a '%s' input control", x, y)
  }
)

app$run_server(debug = TRUE)

Please let me know if there is any problem with this approach. I didn't run the unit & integration tests.

@rpkyle rpkyle changed the base branch from master to dev July 31, 2020 01:13
@rpkyle
Copy link
Contributor

rpkyle commented Jul 31, 2020

@strboul Many thanks for this PR; I think the proposed edits are a nice improvement to this segment of the code (and kudos to you for diving into the stack tracing/error handling functions, which are among the less-friendly parts of the codebase).

(And thanks also for updating the CHANGELOG.md, much appreciated.)

💃

@rpkyle rpkyle self-requested a review July 31, 2020 01:19
@rpkyle rpkyle merged commit 9dd95f6 into plotly:dev Jul 31, 2020
@rpkyle rpkyle mentioned this pull request Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants