fromIncompleteRequest static method

EmbraceNetworkRequest fromIncompleteRequest({
  1. required String url,
  2. required HttpMethod httpMethod,
  3. required int startTime,
  4. required int endTime,
  5. required String errorDetails,
  6. String? traceId,
})

Construct a new EmbraceNetworkRequest instance where a HTTP response was not returned. If a response was returned, use fromCompletedRequest instead.

  • url: the URL of the request.
  • httpMethod: the HTTP method of the request.
  • startTime: the start time of the request.
  • endTime: the end time of the request. Returns a new EmbraceNetworkRequest instance.

Implementation

// ignore: prefer_constructors_over_static_methods
static EmbraceNetworkRequest fromIncompleteRequest({
  required String url,
  required HttpMethod httpMethod,
  required int startTime,
  required int endTime,
  required String errorDetails,
  String? traceId,
}) {
  return EmbraceNetworkRequest._(
    url: url,
    httpMethod: httpMethod,
    startTime: startTime,
    endTime: endTime,
    bytesSent: -1,
    bytesReceived: -1,
    statusCode: -1,
    traceId: traceId,
    errorDetails: errorDetails,
  );
}