checkResult<T> method

  1. @protected
Future<T> checkResult<T>(
  1. ChatSDKEvent actionEvent,
  2. Future<T> method()
)

Implementation

@protected
Future<T> checkResult<T>(
  ChatSDKEvent actionEvent,
  Future<T> Function() method,
) async {
  T result;
  ChatError? error;
  try {
    _onEventBegin(actionEvent);
    result = await method.call();
    return result;
  } on ChatError catch (e) {
    error = e;
    rethrow;
  } finally {
    _onEventEnd(actionEvent, error);
  }
}