title: How to handle the dart excepiton of invalid zlib bytes
body: <p>I've try to implement a function which take zlib bytes as argument using <code>ZLIB</code> of <code>dart:io</code>. And I want the function to catch the error caused by invalid zlib bytes.</p>
  
  <p>However, I couldn't catch it. Because, it's class is a private class.</p>
  
  <p>Here is an example code:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'dart:io';
  main() {
    try {
      ZLIB.decode([1,2,3,4,5]);
    } catch(e) {
      print(e);
      // InternalError: 'Filter error, bad data'
    }
  }
  </code></pre>
  
  <p>I think it can be catched with <code>if (e.toString() == "InternalError: 'Filter error, bad data'")</code> in the <code>catch(e)</code> block. But, <code>toString()</code> is not enough to identify a exception or a error.</p>
  
  <p>What is the best way to handle this error exclude the above string comparison?</p>