I am working on some API (Crittercism) to report handled exceptions in the client to server.
The client API takesNSException
as the input parameter. I have to add some application context info string(NSString
) also to theNSException
before calling the API.
How I can do it using Objective-C.
NSString* appContextString;
NSString *test = @"test";
unichar a;
int index = 5;
@try {
a = [test characterAtIndex:index];
}
@catch (NSException *exception) {
// add app context to exception before reporting to Crittercism.
[Crittercism logHandledException:exception];
}
I have to append appContextString to exception.