title: How to map a "Try with resources" exception type?
body: <p>In a Cyclops React "Try with Resources" block, I would like to map an <code>IOException</code> to a custom exception type. I have tried this also with Javaslang and seems less fexible since it treats all exceptions the same.</p>
  
  <p>Code example:</p>
  
  <pre><code>private static Try&lt;String, ConnectionError&gt; readString() {
      // Socket is a thread-local static field
      final Try&lt;String, IOException&gt; string = Try.catchExceptions(IOException.class)
              .init(() -&gt; new BufferedReader(new InputStreamReader(socket.get().getInputStream())))
              .tryWithResources(BufferedReader::readLine);
  
      return string.isSuccess() ? Try.success(string.get()) :
              Try.failure(new ConnectionError("Could not read from server", string.failureGet()));
  }
  </code></pre>
  
  <p>Could this be done in more elegant way? Or does not make any sense and it would be better to return <code>Try&lt;String, IOException&gt;</code>?</p>
  
  <p>Disclaimer: I am a newbie using the Cyclops React library and functional programming in general, so I may have severe conceptual miscomprehensions.</p>