Skip to content

Error and catching updates

Pre-release
Pre-release
Compare
Choose a tag to compare
@louthy louthy released this 20 Sep 10:19
· 164 commits to main since this release
826005a

Based on this discussion the Error type has had a few changes:

  • The bespoke Equals operators have been removed. Meaning that all Error types use the built-in record structural equality.
  • Is<E>() where E : Exception, the test for an exceptional error contained within the Error, has been renamed to HasException<E>().
  • IsType<E>() where E : Error has been added to test if this contains an E. It's like this is E, but because this might contain many-errors, it checks for the existence of any Error of type E.

The Catch extensions and the @catch combinators have been updated:

  • To fix some obvious bugs!
  • To flip the operands when matching, so the predicate argument is on the left-hand-side where appropriate.
  • Added support for error-codes in Catch (previously missing)

Previous releases:

I did some minor releases that didn't get release notes, so here's a quick summary:

  • notFollowedBy in Parsec reports the correct position
  • Explicit (useAsync) and implicit (via use) support for IAsyncDisposable resources
  • SomeRun overrides for Eff weren't disposing of the EnvIO properly
  • Fin.Apply matching fix
  • LiftM support for StreamT:
    • Previously we could Lift(IAsyncEnumerable<A>) or Lift(IEnumerable<A>) to return a StreamT<M, A>
    • Now we can LiftM(IAsyncEnumerable<K<M, A>>) and LiftM(IEnumerable<K<M, A>>) to also return a StreamT<M, A>