mirror of
https://github.com/haraldh/chainerror.git
synced 2025-01-31 09:04:14 +01:00
12 lines
404 B
Markdown
12 lines
404 B
Markdown
# Simple String Errors
|
|
|
|
The most simplest of doing error handling in rust is by returning `String` as a `Box<Error>`.
|
|
|
|
As you can see by running the example (the "Play" button in upper right of the code block), this only
|
|
prints out the last `Error`.
|
|
|
|
If the rust `main` function returns an Err(), this Err() will be displayed with `std::fmt::Debug`.
|
|
|
|
~~~rust
|
|
{{#include ../examples/tutorial1.rs:2:}}
|
|
~~~ |