captureUserFeedback method

  1. @Deprecated('Will be removed in a future version. Use [captureFeedback] instead')
Future<void> captureUserFeedback(
  1. SentryUserFeedback userFeedback
)

Implementation

@Deprecated(
    'Will be removed in a future version. Use [captureFeedback] instead')
Future<void> captureUserFeedback(SentryUserFeedback userFeedback) async {
  if (!_isEnabled) {
    _options.logger(
      SentryLevel.warning,
      "Instance is disabled and this 'captureUserFeedback' call is a no-op.",
    );
    return;
  }
  if (userFeedback.eventId == SentryId.empty()) {
    _options.logger(
      SentryLevel.warning,
      'Captured UserFeedback with empty id, dropping the feedback',
    );
    return;
  }
  try {
    final item = _peek();

    await item.client.captureUserFeedback(userFeedback);
  } catch (exception, stacktrace) {
    _options.logger(
      SentryLevel.error,
      'Error while capturing user feedback for ${userFeedback.eventId}',
      exception: exception,
      stackTrace: stacktrace,
    );
    if (_options.automatedTestMode) {
      rethrow;
    }
  }
}