domain_error 2.1.0
domain_error: ^2.1.0 copied to clipboard
Domain errors with Either, Result, and executeSafely for expected errors in Dart applications.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
2.1.0 - 2026-08-30 #
Added #
executeSafelySyncandExecuteSafelySyncOptionsfor synchronous calls that returnResult<T>.
2.0.0 - 2026-08-30 #
Changed #
ExecuteSafelyOptions:onErroris nowonDomainError,onThrownis nowonRawError, andmapThrownToErroris nowmapRawErrorToDomain. The options type is no longer generic and no longer extendsEquatable.DomainError.erroris nowrawError.Eitheris sealed. The error branch isisErr/errValue/Either.err. The success branch isisOk/successValue/Either.ok.foldnow takesifErrandifOk.whenis removed.mapmaps the success value and leaves an error unchanged.domainErroris available only onResult<T>, not on a genericEither.executeSafelynow returnsFuture<Result<T>>.FutureOrResultis removed.
1.0.0 - 2026-08-30 #
Added #
DomainErrorbase type with a stabletypeIdentifier, optionalmessage,error, andstackTrace.Eitherwithfailureandvaluebranches, plusfold,when, andmap.Result,FutureResult, andFutureOrResultasEitheraliases overDomainError.executeSafelyto catch throws and return aResult.ExecuteSafelyOptionswithmapThrownToError,onError, andonThrown.