useCaseSync<T> function
Executes the given sync request and returns a UseCase with the result.
Implementation
UseCase<T> useCaseSync<T>(T Function() request) {
try {
return UseCaseSuccess(request());
} on UseCaseException catch (ex) {
return UseCaseFailure(ex);
} catch (ex, st) {
return UseCaseFailure(UnexpectedUseCaseException(ex.toString(), st));
}
}