run method
Implementation
@protected
Future<bool> run(
dynamic Function() handler, {
bool shouldHandleError = true,
}) async {
var success = true;
try {
final result = handler();
if (result is Future) {
await result;
}
} catch (error) {
success = false;
if (shouldHandleError) {
await handleError(error);
}
}
return success;
}