Callback invoked when an error occurs during processing.
Provides a way to handle exceptions thrown by the onPressed callback.
final void Function(Object error)? onError;