fromIncompleteRequest static method
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.errorDetails
: string describing the error detailstraceId
: the trace ID of the request, used for distributed tracing.w3cTraceparent
: a w3c trace parent of the request, used to enable network span forwarding 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,
String? w3cTraceparent,
}) {
return EmbraceNetworkRequest._(
url: url,
httpMethod: httpMethod,
startTime: startTime,
endTime: endTime,
bytesSent: -1,
bytesReceived: -1,
statusCode: -1,
traceId: traceId,
errorDetails: errorDetails,
w3cTraceparent: w3cTraceparent,
);
}