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

Need context information for errors in roclet_process #1490

Closed
ralmond opened this issue Jun 21, 2023 · 3 comments
Closed

Need context information for errors in roclet_process #1490

ralmond opened this issue Jun 21, 2023 · 3 comments
Labels
bug an unexpected problem or unintended behavior rd ✍️
Milestone

Comments

@ralmond
Copy link

ralmond commented Jun 21, 2023

This issue is inspired by #1421, I was having a similar problem, and in entering the debugger, I noticed that the block data element in the function call block_to_rd had information about the file and line number that was being processed at the time. This information needs to be added to any error message which is thrown by block_to_rd

My suggested fix would be to have roclet_process.roclet_rd() (possibly other roclet_process messages catch errors from calls to block_to_rd(), add the file and line number to the error message, and then rethrow the error. This is robust to even unexpected error types.

@hadley
Copy link
Member

hadley commented Jun 22, 2023

Can you please provide a reprex that illustrates the problem?

@ralmond
Copy link
Author

ralmond commented Jun 22, 2023

roxygen2::roxygenise("/home1/ralmond/Projects/Foo")
#> ℹ Loading Foo
#> Error in rd_section_minidesc(name = object_name(block$object), desc = tag$val$description, : is_string(name) is not TRUE

Created on 2023-06-22 with reprex v2.0.2
Here is the minimal project.

Foo.zip

NOTE BENE! This issue is NOT about the specific error being generated, the other issue covers that. This issue is about the fact that uncaught exceptions, such as this one, give no information about where the error occurs, not even the name of the file, or the block being operated on.

@hadley hadley added bug an unexpected problem or unintended behavior rd ✍️ labels Nov 1, 2023
@hadley
Copy link
Member

hadley commented Nov 1, 2023

Thanks!

@hadley hadley added this to the v7.2.4 milestone Nov 2, 2023
@hadley hadley closed this as completed in 968b5b8 Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd ✍️
Projects
None yet
Development

No branches or pull requests

2 participants