1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-07-03 00:46:57 +02:00
Files
.devcontainer
.github
.vscode
exercises
clippy
conversions
enums
error_handling
README.md
errors1.rs
errors2.rs
errors3.rs
errors4.rs
errors5.rs
errors6.rs
functions
generics
hashmaps
if
intro
iterators
lifetimes
macros
modules
move_semantics
options
primitive_types
smart_pointers
strings
structs
tests
threads
traits
variables
vecs
README.md
quiz1.rs
quiz2.rs
quiz3.rs
src
tests
.all-contributorsrc
.editorconfig
.gitignore
.gitpod.yml
.markdownlint.yml
AUTHORS.md
CHANGELOG.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
flake.lock
flake.nix
info.toml
install.ps1
install.sh
oranda.json
shell.nix
rustlings/exercises/error_handling/README.md

13 lines
727 B
Markdown
Raw Normal View History

# Error handling
Most errors aren’t serious enough to require the program to stop entirely.
Sometimes, when a function fails, it’s for a reason that you can easily interpret and respond to.
For example, if you try to open a file and that operation fails because the file doesn’t exist, you might want to create the file instead of terminating the process.
## Further information
- [Error Handling](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
- [Generics](https://doc.rust-lang.org/book/ch10-01-syntax.html)
- [Result](https://doc.rust-lang.org/rust-by-example/error/result.html)
- [Boxing errors](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/boxing_errors.html)