mirror of
https://github.com/haraldh/chainerror.git
synced 2025-06-07 00:24:42 +02:00
parent
188d93a86a
commit
719e221e4b
15 changed files with 31 additions and 28 deletions
|
@ -140,9 +140,10 @@
|
|||
|
||||
<div id="content" class="content">
|
||||
<main>
|
||||
<a class="header" href="#simple-string-errors" id="simple-string-errors"><h2>Simple String Errors</h2></a>
|
||||
<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>As you can see by running the example (the "Play" button in upper right of the code block), 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue