mirror of
https://github.com/haraldh/chainerror.git
synced 2025-06-06 16:14:43 +02:00
parent
cb1bf6dd17
commit
991a7a0786
7 changed files with 24 additions and 6 deletions
|
@ -140,7 +140,11 @@
|
|||
|
||||
<div id="content" class="content">
|
||||
<main>
|
||||
<pre><pre class="playpen"><code class="language-rust">use std::error::Error;
|
||||
<a class="header" href="#simple-string-errors" id="simple-string-errors"><h1>Simple String Errors</h1></a>
|
||||
<p>The most simplest of doing error handling in rust is by returning <code>String</code> as a <code>Box<Error></code>.</p>
|
||||
<p>As you can see by running the example, this only prints out the last <code>Error</code>.</p>
|
||||
<p>If the rust <code>main</code> function returns an Err(), this Err() will be displayed with <code>std::fmt::Debug</code>.</p>
|
||||
<pre><pre class="playpen"><code class="language-rust">use std::error::Error;
|
||||
use std::result::Result;
|
||||
|
||||
fn do_some_io() -> Result<(), Box<Error>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue