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

feat: Correct top-level calls are shown for the vast majority of errors #1379

Merged
merged 47 commits into from
Sep 24, 2022

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Sep 4, 2022

Also call abort() directly, avoid handling condition objects.

This PR uses my_caller_env() from c147ebf to automatically retrieve the calling environment for correct error locations. Is there any downside, compared to the recommended approach of passing caller_env() across the entire chain of calls?

@krlmlr krlmlr force-pushed the f-abort branch 7 times, most recently from ac4ca42 to 0520788 Compare September 4, 2022 19:30
@krlmlr krlmlr changed the title WIP: move to abort() feat: Correct top-level calls are shown for the vast majority of errors Sep 4, 2022
@krlmlr krlmlr requested a review from lionel- September 4, 2022 19:41
@lionel-
Copy link
Member

lionel- commented Sep 5, 2022

This PR uses my_caller_env() from c147ebf to automatically retrieve the calling environment for correct error locations.

🙀

@krlmlr
Copy link
Member Author

krlmlr commented Sep 5, 2022

What levels of horror is your 🙀 cat experiencing?

@lionel-
Copy link
Member

lionel- commented Sep 5, 2022

It's a moderate level of horror. I don't know if this scheme could fail in this case, but I would expect tibble to be exemplary, given its place in the tidyverse, and use the conventional call = caller_env() passing pattern that we use in other packages and which is clearly correct in first analysis.

If it's very costly to add these arguments, then I'd prefer to see some global state peeking/poking, possibly laid out in a stack (e.g. using the call stack via on.exit() restoration of global values) if there is any possibility of recursing into a new instance of tibble code (is there?).

@krlmlr
Copy link
Member Author

krlmlr commented Sep 23, 2022

Thanks. I don't believe we ever recurse. For now I'll add a comment that this is an anti-pattern, I'll deal with it as part of the frontend-backend separation.

@krlmlr krlmlr merged commit c99a954 into main Sep 24, 2022
@krlmlr krlmlr deleted the f-abort branch September 24, 2022 05:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants