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

When codegen fails a backtrace is nice #82

Closed
rsheeter opened this issue Oct 23, 2022 · 5 comments
Closed

When codegen fails a backtrace is nice #82

rsheeter opened this issue Oct 23, 2022 · 5 comments
Assignees

Comments

@rsheeter
Copy link
Collaborator

I found it very helpful to have eprintln!("{}", Backtrace::capture()); before places that return syn::Error's when modifying the codegen. Without it the lovely error told me where in the input the problem was but not so much where in the codegen it might be.

I wonder if it's worth having that as a standard practice?

@rsheeter
Copy link
Collaborator Author

Maybe in a debug log?

@rsheeter
Copy link
Collaborator Author

@rsheeter
Copy link
Collaborator Author

rsheeter commented Nov 5, 2022

Backtrace is no longer experimental in 1.65

@cmyr
Copy link
Member

cmyr commented Nov 7, 2022

Also I realized something about this tension (between showing backtraces versus showing the inline errors) and perhaps i commented on this somewhere earlier? But basically the backtraces are useful if you're working on the actual codegen tool itself, but the inline errors are much more useful if you're working on some other table, and just using the tool.

@rsheeter
Copy link
Collaborator Author

rsheeter commented Nov 7, 2022

I think if I add backtraces in a debug log both users are happy?

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