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

Truncate long calls in abort() #1406

Closed
thomasp85 opened this issue May 20, 2022 · 2 comments
Closed

Truncate long calls in abort() #1406

thomasp85 opened this issue May 20, 2022 · 2 comments

Comments

@thomasp85
Copy link
Member

Currently, adding a multiline call to an error will result in the call vanishing completely. It would be nice if instead the call was truncated and an ellipsis was added to show truncation has occurred.

Current behaviour:

> call <- quote(geom_point(aes(x = mpg, y = disp, size = after_stat(x)), colour = "lightblue", position = position_jitter(width = 3)))
> abort("test", call = I(call))
Error:
! test
Run `rlang::last_error()` to see where the error occurred.

Expected behaviour:

> call <- quote(geom_point(aes(x = mpg, y = disp, size = after_stat(x)), colour = "lightblue", position = position_jitter(width = 3)))
> abort("test", call = I(call))
Error in `geom_point(aes(x = mpg, y = disp, size = after_stat(x))...`:
! test
Run `rlang::last_error()` to see where the error occurred.
@lionel-
Copy link
Member

lionel- commented May 20, 2022

Also look into why foo$bar() calls are not shown in error messages.

lionel- added a commit that referenced this issue Jun 7, 2022
@lionel-
Copy link
Member

lionel- commented Jun 7, 2022

As discussed on Slack, for now we'll keep this undocumented behaviour AsIs ;-)

@lionel- lionel- closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2022
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

No branches or pull requests

2 participants