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

options(error = entrace) does not save error message? #779

Closed
gaborcsardi opened this issue Jun 4, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@gaborcsardi
Copy link
Member

commented Jun 4, 2019

options(error = rlang::entrace)
igraph::make_graph("foobar")

#> Error in make_famous_graph(edges) :
#>   At structure_generators.c:2184 : Unknown graph, see documentation, Invalid value
#> Call `rlang::last_error()` to see a backtrace

rlang::last_error()

#> <error>
#> class:   `rlang_error`
#> backtrace:
#>  1. igraph::make_graph("foobar")
#>  2. igraph:::make_famous_graph(edges)
#> Call `rlang::last_trace()` to see the full backtrace

unclass(rlang:::last_error_env$cnd)

#> $message
#> [1] ""
#> 
#> $trace
#>     █
#>  1. └─igraph::make_graph("foobar")
#>  2.   └─igraph:::make_famous_graph(edges)
#> 
#> $parent
#> NULL

Even though the error message is clearly in the error object:

err <- tryCatch(igraph::make_graph("foobar"), error = function(e) e)
unclass(err)

#> $message
#> [1] "At structure_generators.c:2184 : Unknown graph, see documentation, Invalid value"
#> 
#> $call
#> make_famous_graph(edges)
@gaborcsardi

This comment has been minimized.

Copy link
Member Author

commented Jun 4, 2019

Ideally we would save the whole error object, as is. :/

@lionel- lionel- closed this in 8c98417 Jun 11, 2019

@lionel- lionel- added the cnd label Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.