For the complete documentation index, see llms.txt. This page is also available as Markdown.

Adding Level to Exception

API reference for adding severity levels to exceptions reported with Luciq. Classify exceptions by severity for better crash prioritization.

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

let exception = NSException(name: NSExceptionName("some_exception"), reason: "Exception reason")
if let nonFatalException = CrashReporting.exception(exception) {
    nonFatalException.level = .critical
    nonFatalException.report()
}
NSException *exception = [NSException exceptionWithName:@"some_exception" reason:@"Exception reason" userInfo:nil];
LCQNonFatalException *nonFatalException = [LCQCrashReporting exception:exception];
nonFatalException.level = LCQNonFatalLevelWarning;
[nonFatalException report];
LCQNonFatalException exception = new LCQNonFatalException.Builder(new NullPointerException("Test Exception"))
	.setLevel(LCQNonFatalException.Level.CRITICAL)
	.build();
CrashReporting.report(exception);
val exception = LCQNonFatalException.Builder(NullPointerException("Test Exception"))
	.setLevel(LCQNonFatalException.Level.CRITICAL)
	.build()
CrashReporting.report(exception)

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

.warning
.error
.critical
.info
LCQNonFatalLevelWarning
LCQNonFatalLevelError
LCQNonFatalLevelCritical
LCQNonFatalLevelInfo
LCQNonFatalException.Level.WARNING
LCQNonFatalException.Level.ERROR
LCQNonFatalException.Level.CRITICAL
LCQNonFatalException.Level.INFO

Last updated