title: Handle runtime panic with try macro
body: <p>I'm trying to import a CSV file using <a href="https://crates.io/crates/csv" rel="nofollow">the <code>csv</code> crate</a>, but the problem is that some fields contain non UTF8 values, so I'm getting a runtime panic:</p>
  
  <pre><code>thread '&lt;main&gt;' panicked at 'called `Result::unwrap()` on an `Err` value: Decode("Could not convert bytes \'FromUtf8Error { bytes: [75, 108, 105, 110, 63, 101, 107, 111, 118, 225], error: Utf8Error { valid_up_to: 9 } }\' to UTF-8.")', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:729
  </code></pre>
  
  <p>This is how my code looks like:</p>
  
  <pre><code>extern crate csv;
  
  fn main() {
      let mut rdr = csv::Reader::from_file("data.csv").unwrap();
      for record in rdr.decode() {
          let rec: Vec&lt;String&gt; = record.unwrap();
          println!("{}", rec[0]);
      }
  }
  </code></pre>
  
  <p>I'd like to error handle that panic situation somehow, so I was wondering should I maybe use a <code>try!</code> macro for that? Something like this:</p>
  
  <pre><code>let rec: Vec&lt;String&gt; = try!(record.unwrap());
  </code></pre>
  
  <p>Of course this is producing an error </p>
  
  <pre><code>error: the trait `rustc_serialize::serialize::Decodable` is not implemented for the type `core::result::Result&lt;_, _&gt;` [E0277]
  </code></pre>
  
  <p>What would be the correct syntax?</p>