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

Better error handling #1

Open
LaurentMazare opened this issue Jan 7, 2024 · 3 comments
Open

Better error handling #1

LaurentMazare opened this issue Jan 7, 2024 · 3 comments

Comments

@LaurentMazare
Copy link

It would be great if errors could be used in favor of panics and also if bindgen_cuda::Error could implement the std::error::Error trait.

@Narsil
Copy link
Owner

Narsil commented Jan 10, 2024

What does it change for builds ? I started doing that but the error messages where not really great when I started doing so, since it swallowed the stack and I don't really want to pull anyhow to get the backtrace (which pretty much does just like a panic).

I don't really see the benefit of non panicking during builds, especially if the error is unrecoverable (like cuda cannot be found).

@LaurentMazare
Copy link
Author

I guess it leaves the flexibility of panicking or not to the library's users rather than deciding what's the best for them (and if they only want to use this for builds or something else). The error message being explicit and different I'm not sure the backtrace would be worth it indeed so would just go with a very simple error type.

@Narsil
Copy link
Owner

Narsil commented Jan 11, 2024

Fair enough, bindgen also has a CLI anyway which I think can come in handy and we'd definitely need errors there too.

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