When the host application attempts to send a telemetry event, but hasn't yet initialized the TelemetryManager, the manager calls fatalError():
public static var shared: TelemetryManager {
if let telemetryManager = initializedTelemetryManager {
/* […] */
} else {
fatalError("Please call TelemetryManager.initialize(...) before accessing the shared telemetryManager instance.")
}
}
As a result, if in a released app, a rarely occurring code path unexpectedly calls TelemetryManager.send() too early, the app will crash.
This is not good! A failure to send a telemetry event is not a fatal event, and the SDK should not make this crashing choice on the behalf of the host app. In my opinion, an assertionFailure call would be much more appropriate.
When the host application attempts to send a telemetry event, but hasn't yet initialized the TelemetryManager, the manager calls
fatalError()
:As a result, if in a released app, a rarely occurring code path unexpectedly calls
TelemetryManager.send()
too early, the app will crash. This is not good! A failure to send a telemetry event is not a fatal event, and the SDK should not make this crashing choice on the behalf of the host app. In my opinion, anassertionFailure
call would be much more appropriate.