<itemvalue="If `test` returns `true`, [onError] is called with the error and possibly stack trace, and the returned future is completed with the result of this call in exactly the same way as for [then]'s `onError`. If `test` is omitted, it defaults to a function that always returns true. The `test` function should not throw, but if it does, it is handled as if the `onError` function had thrown. Note that futures don't delay reporting of errors until listeners are added. If the first `catchError` (or `then`) call happens after this future has completed with an error then the error is reported as unhandled error. See the description on [Future]."/>
<itemvalue="If [onError] is not given, and this future completes with an error, the error is forwarded directly to the returned future. In most cases, it is more readable to use [catchError] separately, possibly with a `test` parameter, instead of handling both value and error in a single [then] call. Note that futures don't delay reporting of errors until listeners are added. If the first `then` or `catchError` call happens after this future has completed with an error, then the error is reported as unhandled error. See the description on [Future]."/>