asFailure property

Failure<AppError> asFailure

Cast this into a Failure, and throw an exception if the cast fails! It might be tempting to just cast the result into the desired type, but it's strongly advised to not do that. Although, it might be convenient to have this cast sometimes. Use it wisely!

Implementation

Failure<AppError> get asFailure => this as Failure<AppError>;