setHttpResponseCode method

  1. @override
dynamic setHttpResponseCode(
  1. int code
)
override

Implementation

@override
setHttpResponseCode(int code) {
  if (kDebugMode) {
    logger?.debug(
        this, 'Application is in debug mode, not setting the response code');
    return;
  }

  if (!kCanTrace) {
    logger?.debug(this, 'Firebase Http Metric is not allowed to trace');
    return null;
  }

  if (kInstance == null) {
    logger?.error(this, 'Firebase Http Metric is not initialized');
    return;
  }

  kInstance?.httpResponseCode = code;
}