yak_error_handler library

Classes

ErrorHandler<T extends Error>
wrap the HandleError function in a callable class to use the covariant argument

Extensions

AsTypeX on S
extension on Object?
ErrorHandlerCovariantX on ErrorHandler<T>
this extension allow using an ErrorHandler with T != Error in
ErrorHandlerX on HandleError<T>
an extension to easily switch between ErrorHandler (class) and HandleError(typedef) to avoid contravariance issues
ErrorReportX on T
an extension on Error
HandleErrorX on HandleError<T>
an extension on HandleError
SilenceErrorX on T
an extension to easily switch between ErrorHandler (class) and HandleError(typedef) to avoid contravariance issues

Functions

avow(bool assertion, [Object? message]) → void
a function that recreate the behavior of assert pre-nnbd the positionl bool is necessary to replicated assert

Typedefs

HandleError<T extends Error> = void Function(T e)
a typedef for void Function(Error e)

Exceptions / Errors

AsTypeError<T, S>
identical to TypeError but more informative
AvowError
identical to AssertionError
ErrorReport
as Exception are impossible to work with thanks to the apprach factory Foo() => _Foo(); this wrapper should allow to handle assertion as Error