Console and error handling in released Apps

Hi Codeans,

After a year of development our app is nearly ready for release. We are in final stages of playtesting and balancing…

I have seen one or two slightly related posts, but wonder if anyone can shed light on following questions:

  1. Suppressing console: Obviously I will be setting the ‘no buttons’ display mode, and I also detect number of concurrent touches and re-force the ‘no button’ mode if this is >= 3 to suppress Codea’s buil-tin button overlay functions… This is OK, but is it possible to suppress this entirely in a released app?

  2. Is there any way to catch errors so the console is not ‘force displayed’? Ideally I’d like to do some of our own error handling…

I guess these would be part of the Codea runtime…

@Simeon or others, any guidance?

Thanks

Brookesi

BrookeVickers

I am also interested in this as I will be releasing a developer version of my app which allows the console and the normal release which doesn’t, so people can manipulate the innards of it in developer version.

Hi @Simeon, @Luatee

Bumping this as it is a concern. We have put our hearts and souls into creating our game over the last year, but if someone accessed the console, presumably they could use listProjectTabs and readProjectTab to actually get the raw Lua code…

I have just realized that in my main I can set these functions to nil which will stop nefarious code theft…

But doing our own error handling in console or ObjC would be very useful…

Brookesi

@Brookesi do you know about pcall()? It should avoid errors.

Hi @Jmv38,

Many thanks, I guess in order to handle all errors I would create my own versions of setup(), draw() and touched() at the highest level in main, and pcall those, e.g.:

function setupImpl()
    -- My setup code
end

function setup()

    local success, returnValue, errorMsg = pcall(setupImpl())

    -- Do error handling stuff
end

Will try that and see if there are performance implications…

Thanks again,

Brookesi