setErrorHandler<T> method

  1. @override
void setErrorHandler<T>(
  1. ErrorHandlerCallback<T> handler
)
override

Provides a handler Function to handle any calls from handleError. Handles T which is error-like object which is typically thrown by try-catch blocks inside the GetxControllerPlus scope.

Typically called in either onInit step or the context of the Widget itself.

Implementation

@override
void setErrorHandler<T>(ErrorHandlerCallback<T> handler) {
  final Type type = _typeOf<T>();
  _errorHandlers[type] = handler;
}