onError method

  1. @override
void onError(
  1. Object error,
  2. StackTrace stackTrace
)
override

Called when an error occurs during computation in a Computed instance.

This method is only relevant for middleware attached to Computed instances. It is called when the compute function throws an error.

Parameters:

  • error: The error that was thrown
  • stackTrace: The stack trace of the error

Implementation

@override
void onError(Object error, StackTrace stackTrace) {
  print("Error: $error\n$stackTrace");
}