onError<O extends OptionDefinition, T> static method

CommandMiddleware<O, T> onError<O extends OptionDefinition, T>(
  1. OnError<T?, CommandContext<O, T>> onError
)

Creates a CommandMiddleware with the given onError hook.

See MiddlewareHooks.onError.

Implementation

static CommandMiddleware<O, T> onError<O extends OptionDefinition, T>(
  final OnError<T?, CommandContext<O, T>> onError,
) {
  return withHooks(onError: onError);
}