Has anyone managed to get flurry to correctly do crash reporting?
I have the following init
flurry.init(flurryListener, { apiKey = apiKey, crashReportingEnabled = true, logLevel = "all" })
Has anyone managed to get flurry to correctly do crash reporting?
I have the following init
flurry.init(flurryListener, { apiKey = apiKey, crashReportingEnabled = true, logLevel = "all" })
local function myUnhandledErrorListener( event ) table.print_r(event) local iHandledTheError = true if iHandledTheError then print( "Handling the unhandled error", event.errorMessage ) flurryListener(event) flurry.logEvent( "logError", { message=event.errorMessage, exception=event.stackTrace }) flurry.logEvent( "Application_UnhandledException", { name="uncaught", reason=event.stackTrace }) flurry.logEvent( "debug", { name="uncaught", reason=event.stackTrace }) flurry.logEvent( "Uncaught", { name="uncaught", reason=event.stackTrace }) flurry.logEvent( "Application_UnhandledException", event) flurry.logEvent( "debug", event) flurry.logEvent( "uncaught", event) else print( "Not handling the unhandled error", event.errorMessage ) end return iHandledTheError end Runtime:addEventListener("unhandledError", myUnhandledErrorListener)
If you can hold on till next weekend I am building the following calls as a plugin. Not sure if this is what you are looking for. I currently have them in my native builds.
/*! * @brief Records an app exception. Commonly used to catch unhandled exceptions. * @since 2.7 * * This method captures an exception for reporting to Flurry. We recommend adding an uncaught * exception listener to capture any exceptions that occur during usage that is not * anticipated by your app. * * @see #logError:message:error: for details on capturing errors. * * @code * - (void) uncaughtExceptionHandler(NSException *exception) { [Flurry logError:@"Uncaught" message:@"Crash!" exception:exception]; } - (void)applicationDidFinishLaunching:(UIApplication *)application { NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler); [Flurry startSession:@"YOUR_API_KEY"]; // .... } * @endcode * * @param errorID Name of the error. * @param message The message to associate with the error. * @param exception The exception object to report. */ + (void)logError:(nonnull NSString *)errorID message:(nullable NSString *)message exception:(nullable NSException *)exception;
/*! * @brief Records an app error. * @since 2.7 * * * @see #logError:message:exception: for details on capturing exceptions. * * @code * - (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { [Flurry logError:@"WebView No Load" message:[error localizedDescription] error:error]; } * @endcode * * @param errorID Name of the error. * @param message The message to associate with the error. * @param error The error object to report. */ + (void)logError:(nonnull NSString *)errorID message:(nullable NSString *)message error:(nullable NSError *)error;
Awesome. Count me in.
Will this work alongside the regular flurry plugin so I can log standard events?
Cheers,
Craig
I have not started it yet but it is on the list, the day is long, and it is not something that will take me a long time. At most a couple of hours. Even if it slips off today's list, it will be done by Monday. You'll get a chance to use it this week after Corona approves it and uploades it.
I mean if I don't run into some random problem with it (which is not very likely).
I was about to create the plugin and looking at the Android implementation of flurry those methods don't exist on the Android side. flurry just captures any exception that is being thrown by Android. I don't have time to look at this right now but it would be interesting to see what Corona does with a lua runtime error. If all they do is abort and don't fire an exception then all you would get in flurry is the crash.
I could only think of two ways around this and neither seems to be ideal.
1. Add it to the corona source code so that it throws an exception with the details before aborting the runtime.
2. Or create a plugin that throws a java exception that flurry can then capture. Using the exception handler in Corona to fire the plugin method to generate a java exception.
Sorry, I can't create a plugin. If the methods were available in Android it would have been easy. I still might do the Apple version in the coming days.