invoke method
Invokes the Runnable on the given input
.
Implementation
@override
Future<RunOutput> invoke(RunInput input, {RunnableOptions? options}) async {
Object? firstError;
for (final runnable in [mainRunnable, ...fallbacks]) {
try {
return await runnable.invoke(
input,
options: firstError == null
? options
: runnable.getCompatibleOptions(options),
);
} catch (e) {
firstError ??= e;
}
}
throw Exception('All runnables failed. First error: $firstError');
}