Use onError over catchError

`Future.catchError` is more error prone in null safe dart than `onError`
because return type of the `Function` callback is not statically
enforced and `null` was a common default value which no longer works.

Migrate all calls from `catchError` to `onError` to demonstrate best
practices. The other usages in this package are mostly on
`Future<dynamic>` and mostly look safe, though I can't rule out a type
error in unusual situations.

There was at least one mistake made in the migration of this library -
the code to ignore errors when completing a `CancelableOperation` as an
error after it was already canceled would instead cause a type error to
surface. Fix this and add a test.
11 files changed
tree: c81593fa5c522a89c36eb8c7eb3e02338aada2a2
  1. .github/
  2. .gitignore
  3. AUTHORS
  4. CHANGELOG.md
  5. CONTRIBUTING.md
  6. LICENSE
  7. README.md
  8. analysis_options.yaml
  9. lib/
  10. pubspec.yaml
  11. test/
README.md

Contains utility classes in the style of dart:async to work with asynchronous computations.