Skip to content

Commit

Permalink
fix error handling when simple error in teal_data_module
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Nov 10, 2023
1 parent 7d5ccc3 commit 6570474
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
FALSE,
paste0(
"Error when executing `teal_data_module`:\n ",
attr(data, "condition")$message,
data$message,
"\n Check your inputs or contact app developer if error persists"
)
)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ testthat::test_that("srv_teal_with_splash raw_data_checked throws when teal_data
id = "test",
data = teal_data_module(
ui = function(id) div(),
server = function(id) reactive(stop())
server = function(id) reactive(stop("this error"))
),
modules = modules(example_module())
),
expr = {
testthat::expect_is(raw_data_checked, "reactive")
testthat::expect_error(raw_data_checked(), "Error when executing `teal_data_module`")
testthat::expect_error(raw_data_checked(), "this error")
}
)
})
Expand Down

0 comments on commit 6570474

Please sign in to comment.