Director gives uninformative debug logs?

Whenever I have a error in one of my lua files while using Director, it usually gives very uninformative error logs.
Is there a way to fix this?
director.lua:440: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’
stack traceback:

Director ERROR: Failed to execute function: 0x18baf10( params ) function on ‘menu’.

[import]uid: 40413 topic_id: 13875 reply_id: 313875[/import]

I rolled back to the previous version of Director because of this… I haven’t found a fix for it. [import]uid: 12540 topic_id: 13875 reply_id: 50987[/import]

*double post* [import]uid: 12540 topic_id: 13875 reply_id: 50988[/import]

Quick question… In your .lua files (excluding main.lua) are you including the following line ?

module(…, package.seeall) [import]uid: 6981 topic_id: 13875 reply_id: 51016[/import]

On Director 1.4 the error messages will be better, I promise! [import]uid: 8556 topic_id: 13875 reply_id: 51020[/import]

I had lots of those errors last night. Mostly, they were because I forgot a closing bracket ‘)’. [import]uid: 10389 topic_id: 13875 reply_id: 51022[/import]

The errors might be less informative or useful, but they atleast are handled than trying to figure out where the errors are.

I think that is a great step and will await the next release

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 13875 reply_id: 51029[/import]

I have lots of problems with those errors too! Sometime it can take me about 20 min to figure out what it is, then I switch over to the old director class and it tells you the line. Then I switch back over, etc. You just have to work with it.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 13875 reply_id: 51034[/import]

I do like this in my main file:

[lua]–local DEBUG = true
local scene = “someScene”

if ( DEBUG ) then
local mainView = require ( scene ).new()
else

local director = require(“director”)
local mainGroup = display.newGroup()

local main = function ()

mainGroup:insert(director.directorView)
director:changeScene( scene )

return true
end
main()
end[/lua]

when I work on a scene and get an directorerror I just uncomment this line:
local DEBUG = true

and i will get the usual error information [import]uid: 13632 topic_id: 13875 reply_id: 51062[/import]

Thanks for the tip ojnab, this bit of code has saved me quite a lot of exploratory print statements whilst trying to locate bugs. [import]uid: 81475 topic_id: 13875 reply_id: 51727[/import]

How does the debug code above work? When I put it in my file it just blacked out everything.

[import]uid: 72372 topic_id: 13875 reply_id: 52776[/import]

you have to structure your code as shown in the director 1.3 example.

and in this line [lua] local scene = “someScene” [/lua]
you change “someScene” to the name of the scene you want to debug. [import]uid: 13632 topic_id: 13875 reply_id: 52825[/import]

@ojnab, I’m restructuring my game modules and this is helping me a lot to debug why a scene IS having trouble loading. Thanks so much! [import]uid: 67217 topic_id: 13875 reply_id: 52877[/import]