• Log inStart now

noticeNetworkFailure (iOS SDK API)

Syntax

+ (void)noticeNetworkFailureForURL:(NSURL*)url
httpMethod:(NSString*)httpMethod
withTimer:(NRTimer*)timer
andFailureCode:(NSInteger)iOSFailureCode;

Manually record a failed transactional network request.

Requirements

Compatible with all agent versions.

Description

Failed requests are requests that fail to receive a complete response from the server caused by things like TCP timeouts, SSL failures, connection closures, and more.

The failure codes you pass into this method should correlate to Apple's documented NSURLConnection failure codes.

Parameters

Parameter

Description

$url

NSURL

Required. The URL of the request.

$httpMethod

string

Required. The HTTP method of the request.

$timer

NRTimer

Required. A timer that captures the start and end of the request.

$iOSFailureCode

NSInteger

Required. The failure codes you pass into this method should correlate to Apple's documented NSURLConnection failure codes.

Examples

Objective-C

Example:

[NewRelic noticeNetworkFailureForURL:[NSURL URLWithString:@"https://www.newrelic.com"]
httpMethod:@"GET"
withTimer:[[NRTimer alloc] init]
andFailureCode:NSURLErrorTimedOut];

Swift

Example:

NewRelic.noticeNetworkFailure(for: URL(string: "https://www.newrelic.com"), httpMethod: "GET",
with: NRTimer(), andFailureCode: NSURLErrorTimedOut)
Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.