Question

I am developing a phonegap application for iOS devices. I also integrated bugsense for iOS.

I am using window.onError from javascript to catch errors and then use a Webview delegate method to perform exception handling. This is where I create a custom NSException object and use BUGSENSE_LOG() method to log exception. But that is not working. This is the error that I get:

 BugSense --> Server responded with status code: 500

This is my code:

NSDictionary *myDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"Source", @"Phonegap ios", nil];

NSException *exc = [NSException exceptionWithName:@"MyException" reason:completeMessage userInfo:myDictionary];    
//[exc raise];
BUGSENSE_LOG(exc, @"Tag");

I have turned the debugger off and I am making a release build. I have checked my settings as well and everything seems as per the guidelines given on the Bugsense official website.

Thanks in advance for your replies.

Was it helpful?

Solution

WELL .. I was able to find the solution to my own problem. All I did was instead of creating the NSException object, I raised an exception, caught it and then logged it. Surprisingly it worked..

 @try {
    [NSException raise:@"MyException" format:@"%@,%@,%@",message,url,lineNumber];
}
@catch (NSException *exception) {        
    BUGSENSE_LOG(exception, @"tag");
}

OTHER TIPS

please look into this that was reported by Bug sense Guys. See the URL https://groups.google.com/forum/?fromgroups=#!topic/phonegap/9JasIb4Jlg4

Hi guys, thanks for bringing it up. We have started experimenting with PhoneGap but we had found the following issue. window.onerror was not working on Android so we could not have a global uncaught exception handler. Then we thought of creating a Bugsense callback that you could add to the onerror callbacks of Phonegap.

If you have any suggestions we would be more than happy to listen to them. We are also publishing the structure of our api so that you can create your own plugins. Btw, we have some HTML5 support https://github.com/soundcloud/Bugsense-js https://github.com/crcn/mesh-bugsense

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top