What is wrong with this Dart error handler? : <p>I'm doing some (I thought) basic exception handling in dart / flutter.  I'm using the latest versions of dart and flutter as of last week (3/15/2019).</p>

<p>Here's my code: </p>

<pre><code>void MyMethod() {
    Storage.getFilePaths().then((paths) {
      //do something
    }).catchError((Exception error) {
      //do something else
      return null;
    });
 }
</code></pre>

<p>However, when running the program and when an exception occurs I get this message below and can't see what the problem is?</p>

<blockquote>
  <p>'Invalid argument (onError): Error handler must accept one Object or
  one Object and a StackTrace as  arguments, and return a a valid
  result: Closure: (Exception) => Null'</p>
</blockquote>

<p>I assume I'm missing something silly, and would love to learn what that is. </p>
