-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use knitr instead of rmarkdown - Test error thrown and capture in cell output
- Loading branch information
Showing
10 changed files
with
138 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
|
||
|
||
processing file: with-abort-error.Rmd | ||
Error in `h()`: | ||
! ! | ||
Backtrace: | ||
1. global f() | ||
2. global g() | ||
3. global h() | ||
|
||
Quitting from lines 6-10 [unnamed-chunk-1] (with-abort-error.Rmd) | ||
▆ | ||
1. ├─evaluate::evaluate(...) | ||
2. │ ├─base::withRestarts(...) | ||
3. │ │ └─base (local) withRestartList(expr, restarts) | ||
4. │ │ ├─base (local) withOneRestart(withRestartList(expr, restarts[-nr]), restarts[[nr]]) | ||
5. │ │ │ └─base (local) doWithOneRestart(return(expr), restart) | ||
6. │ │ └─base (local) withRestartList(expr, restarts[-nr]) | ||
7. │ │ └─base (local) withOneRestart(expr, restarts[[1L]]) | ||
8. │ │ └─base (local) doWithOneRestart(return(expr), restart) | ||
9. │ ├─evaluate:::with_handlers(...) | ||
10. │ │ ├─base::eval(call) | ||
11. │ │ │ └─base::eval(call) | ||
12. │ │ └─base::withCallingHandlers(...) | ||
13. │ ├─base::withVisible(eval(expr, envir)) | ||
14. │ └─base::eval(expr, envir) | ||
15. │ └─base::eval(expr, envir) | ||
16. └─global f() | ||
17. └─global g() | ||
18. └─global h() | ||
19. └─rlang::abort("!") | ||
Execution halted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: document with error | ||
--- | ||
|
||
|
||
``` r | ||
f <- function() g() | ||
g <- function() h() | ||
h <- function() rlang::abort("!") | ||
f() | ||
``` | ||
|
||
``` | ||
## Error in `h()`: | ||
## ! ! | ||
## Backtrace: | ||
## x | ||
## 1. \-evaluate (local) f() | ||
## 2. \-evaluate (local) g() | ||
## 3. \-evaluate (local) h() | ||
## 4. \-rlang::abort("!") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
processing file: ressources/with-abort-error.Rmd | ||
Error in `h()`: | ||
! ! | ||
Backtrace: | ||
1. global f() | ||
2. global g() | ||
3. global h() | ||
|
||
Quitting from lines 6-10 [unnamed-chunk-1] (ressources/with-abort-error.Rmd) | ||
Execution halted |
12 changes: 12 additions & 0 deletions
12
tests/testthat/_snaps/conditions/rmd-stop-error-auto-entrace.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
processing file: ressources/with-stop-error-auto-entrace.Rmd | ||
Error in `h()`: | ||
! ! | ||
Backtrace: | ||
1. global f() | ||
2. global g() | ||
3. global h() | ||
|
||
Quitting from lines 11-15 [unnamed-chunk-2] (ressources/with-stop-error-auto-entrace.Rmd) | ||
Execution halted |
27 changes: 27 additions & 0 deletions
27
tests/testthat/_snaps/conditions/rmd-stop-error-entrace-sewed.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: document with error | ||
--- | ||
|
||
|
||
``` r | ||
rlang::global_entrace() | ||
options(rlang_backtrace_on_error_report = "full") | ||
``` | ||
|
||
|
||
``` r | ||
f <- function() g() | ||
g <- function() h() | ||
h <- function() stop("!") | ||
f() | ||
``` | ||
|
||
``` | ||
## Error in `h()`: | ||
## ! ! | ||
## Backtrace: | ||
## x | ||
## 1. \-evaluate (local) f() | ||
## 2. \-evaluate (local) g() | ||
## 3. \-evaluate (local) h() | ||
``` |
12 changes: 0 additions & 12 deletions
12
tests/testthat/_snaps/conditions/stop-error-auto-entrace.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: document with error | ||
--- | ||
|
||
```{r} | ||
rlang::global_entrace() | ||
``` | ||
|
||
|
||
```{r} | ||
f <- function() g() | ||
g <- function() h() | ||
h <- function() stop("!") | ||
f() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters