runStep<T> method
Wraps a unit of work in consistent logging and exception translation.
Implementation
Future<T> runStep<T>(String description, Future<T> Function() action) async {
Logger.info('Running: $description...');
try {
return await action();
} on BuildException {
rethrow;
} catch (e, s) {
throw BuildException(
'Failed step: "$description" ($e)',
fix: 'Check task logs above or underlying system prerequisites.',
originalStackTrace: s,
);
}
}