Adding Level To Error

You can set different levels for manually reported errors using the following API:

let error = NSError(domain: "com.service.method", code: 404)
if let nonFatalError = CrashReporting.error(error) {
    nonFatalError.level = .critical
    nonFatalError.report()
}

Here are the different severity levels available. In case no level is indicated, the default level would be error.

.warning
.error
.critical
.info

Last updated