@ExperimentalApi public final class HttpTraceUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static io.opencensus.trace.Status |
parseResponseStatus(int statusCode,
Throwable error)
Parse OpenCensus Status from HTTP response status code.
|
public static final io.opencensus.trace.Status parseResponseStatus(int statusCode,
@Nullable
Throwable error)
This method serves a default routine to map HTTP status code to Open Census Status. The mapping is defined in Google API canonical error code, and the behavior is defined in OpenCensus Specs.
statusCode - the HTTP response status code. 0 means invalid response.error - the error occurred during response transmission (optional).Status.