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

Adding a small explanations on hardware exceptions vs software exceptions #312

Open
Dajamante opened this issue Mar 7, 2022 · 0 comments

Comments

@Dajamante
Copy link

Dajamante commented Mar 7, 2022

In the book there is a paragraph on hardware exceptions:
https://docs.rust-embedded.org/book/start/exceptions.html?highlight=exception#the-default-exception-handler
This can be a question mark for people used to software exceptions.

What about adding, directly after the first paragraph:

Hardware exceptions are different from exceptions thrown in software, which are a way of handling errors for both recoverable and unrecoverable errors. For recoverable error handling, Rust uses the Result type Result<T, E>, where T is the Ok value type, and E is a specific, configurable error. For unrecoverable software error handling, Rust uses panic that stops execution. This is closer to exceptions thrown in software using other languages.

If you think it can be a useful addition I can make a PR.

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

1 participant