title: Dealing with optional field with lihaoyi ujson
body: <p>I want to use ujson of the <a href="http://www.lihaoyi.com/upickle/#uJson" rel="nofollow noreferrer">upickle library</a> to extract an optional string from a json document. In some documents the json field exists, in others not.</p>
  
  <p>When acessing the field and the field does not exist I get a NoSuchElementException:</p>
  
  <pre><code>val json = ujson.read(jsonString)
  json("attributename").str
  
  results in: java.util.NoSuchElementException: key not found: attributename
  </code></pre>
  
  <p>What is the idiomatic way to deal with optional json attributes in ujson?</p>