Unhandled Errors cause black screens

Hello,

I have implemented a runtime error handler, as seen on various part of the doc, but they always cause a black screen.

If I catch an error and return false, I get the usual error popup, but if I return true (which should let the application continue) the app gets in black screen mode (code still running, no crash, Corona just doesn’t show anything to the screen).

Here’s my code

local errorCount = 0 local maxErrorCount = 30 local unhandledErrorListener = function (event) if event.errorMessage then print("[CORONA]&nbsp;Unhandled error: " .. event.errorMessage .. event.stackTrace) end errorCount = errorCount + 1 if errorCount \<= maxErrorCount then GA.newEvent("error", {message = event.errorMessage .. event.stackTrace, severity = "critical"}) end print("ERROR HANDLER WORKING") return true end Runtime:addEventListener("unhandledError", function (event) return unhandledErrorListener(event) end)

But actually my code doesn’t really matter here. Even if I just return true in the handler with no other code the same thing happens.

I have tried generating errors by calling the error function at different places (in the main, in a scene show-did event, etc.) and I have tried creating the runtime error handler at different places too.

This is on version 2015.2552

Oh and also, nothing in the console (but my prints do appear)

Have you tried simply:

Runtime:addEventListener( "unhandledError", handleSystemErrors)

Then have:

local function handleSystemErrors (event ) &nbsp; [stuff] end

That approximate approach works for me on 2015.2553 and earlier. Maybe add it to Everyone’s Favorite Fishies Demo App and see what happens if you try to catenate a nil to a string or something simple.

Well I have tried the simplest form possible (just a local function that only returns true) and it always did the same thing.

I didn’t try on another app, but in any case if corona has a black screen when catching errors that’s a bug

Have you tried simply:

Runtime:addEventListener( "unhandledError", handleSystemErrors)

Then have:

local function handleSystemErrors (event ) &nbsp; [stuff] end

That approximate approach works for me on 2015.2553 and earlier. Maybe add it to Everyone’s Favorite Fishies Demo App and see what happens if you try to catenate a nil to a string or something simple.

Well I have tried the simplest form possible (just a local function that only returns true) and it always did the same thing.

I didn’t try on another app, but in any case if corona has a black screen when catching errors that’s a bug