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

Dev evaluate gives bad traceback #214

Closed
hadley opened this issue Jul 30, 2024 · 2 comments · Fixed by #223
Closed

Dev evaluate gives bad traceback #214

hadley opened this issue Jul 30, 2024 · 2 comments · Fixed by #223

Comments

@hadley
Copy link
Member

hadley commented Jul 30, 2024

With this qmd:

```{r}
f <- function() g()
g <- function() h()
h <- function() i()
i <- function() stop("!")
f()
```

CRAN evaluate errors with:

Error in `i()`:
! !
Backtrace:
 1. global f()
 2. global g()
 3. global h()
 4. global i()

But with dev evaluate:

Backtrace:
 1. evaluate (local) `<fn>`()
 2. base::withRestarts(...)
 3. base (local) withRestartList(expr, restarts)
 4. base (local) withOneRestart(withRestartList(expr, restarts[-nr]), restarts[[nr]])
 5. base (local) docall(restart$handler, restartArgs)
 7. evaluate (local) fun(base::quote(`<smplErrr>`))
@hadley
Copy link
Member Author

hadley commented Aug 21, 2024

Simpler reprex:

f <- function() g()
g <- function() h()
h <- function() i()
i <- function() stop("!")

evaluate::evaluate("f()", stop_on_error = 2L)

@hadley
Copy link
Member Author

hadley commented Aug 21, 2024

Another piece: evaluate('stop("1")\n2', stop_on_error = 2L)

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 a pull request may close this issue.

1 participant