title: Catch an error and return a new type in RxJava2
body: <p>I have a stream:</p>
  
  <pre><code>val symbols: Single&lt;List&lt;Symbol&gt;&gt;
  </code></pre>
  
  <p>Now I want to transform the stream into a UI State with map():</p>
  
  <pre><code>private fun cool(): Single&lt;SymbolContract.State&gt; =
      symbols.map { SymbolContract.State.Symbols(it) }
  </code></pre>
  
  <p>What I want to do is catch an error on the upstream <code>symbols</code> single, so that I can catch any errors and then return <code>SymbolContract.State.GeneralError()</code>.</p>
  
  <p>I want something like a <code>onErrorMap()</code> or something. Unfortunately, putting <code>onErrorResumeItem</code> on <code>symbols</code> doesn't work because it needs to return a <code>List&lt;Symbol&gt;</code>.</p>
  
  <p>I can think of a few ugly ways to do this, but what's the cleanest?</p>