How do i decipher errors?

I am having this error in my app and I cant decipher it.Can someone walk me through deciphering this so I can do the next one on my own .

Error:

Windows simulator build date: May 27 2015 @ 18:15:50

Copyright © 2009-2015  C o r o n a   L a b s   I n c .
        Version: 3.0.0
        Build: 2015.2646
Platform: SM-G900S / x64 / 6.2 / Intel® HD Graphics / 4.0.0 - Build 10.18.10.3
408 / 2015.2646
Loading project from:   c:\users\true\documents\corona projects\test bench
Project sandbox folder: C:\Users\True\AppData\Roaming\Corona Labs\Corona Simulat
or\Sandbox\test bench-ED6DFA467C72057C41608B6099A18169\Documents
create initialized?     table: 066691F8
Runtime error
?:0: attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
        ?: in function ‘gotoScene’
        c:\users\true\documents\corona projects\test bench\main.lua:34: in funct
ion ‘_listener’
        ?: in function <?:141>
        ?: in function <?:221>

Copyright © 2009-2015  C o r o n a   L a b s   I n c .
        Version: 3.0.0
        Build: 2015.2646
Platform: SM-G900S / x64 / 6.2 / Intel® HD Graphics / 4.0.0 - Build 10.18.10.3
408 / 2015.2646
Loading project from:   c:\users\true\documents\corona projects\test bench
Project sandbox folder: C:\Users\True\AppData\Roaming\Corona Labs\Corona Simulat
or\Sandbox\test bench-ED6DFA467C72057C41608B6099A18169\Documents
create initialized?     table: 0675AA58
Runtime error
?:0: attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
        ?: in function ‘gotoScene’
        c:\users\true\documents\corona projects\test bench\main.lua:34: in funct
ion ‘_listener’
        ?: in function <?:141>
        ?: in function <?:221>

Copyright © 2009-2015  C o r o n a   L a b s   I n c .
        Version: 3.0.0
        Build: 2015.2646
Platform: SM-G900S / x64 / 6.2 / Intel® HD Graphics / 4.0.0 - Build 10.18.10.3
408 / 2015.2646
Loading project from:   c:\users\true\documents\corona projects\test bench
Project sandbox folder: C:\Users\True\AppData\Roaming\Corona Labs\Corona Simulat
or\Sandbox\test bench-ED6DFA467C72057C41608B6099A18169\Documents
create initialized?     table: 066A3048
Runtime error
?:0: attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
        ?: in function ‘gotoScene’
        c:\users\true\documents\corona projects\test bench\main.lua:34: in funct
ion ‘_listener’
        ?: in function <?:141>
        ?: in function <?:221>

Main.lua:

----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local physics = require( "physics" ) physics.start() physics.setGravity(0, 15) -- display ground image local ground = display.newImageRect( "ground.png", 500, 100 ) ground.x = 145; ground.y = 480 ground.myName = "ground" ground.isGround = true physics.addBody( ground, "static" , { friction=0.5, bounce=0.1 } ) local crate = display.newImageRect( "crate.png", 90, 90 ) print("create initialized? ", crate ) crate.x = 60; crate.y = 20 crate.rotation = 0 crate.myName = "crate" crate.isCrate = true physics.addBody( crate, "dynamic" , { friction=0.5, bounce=0.3 } ) local function onCollision( self, event ) local other = event.other if( event.phase == "began" and self.isCrate and other.isGround ) then timer.performWithDelay( 30, function() composer.gotoScene ( "restart", "fade", 500 ); end) self:removeEventListener( "collision" ) end return true end crate.collision = onCollision crate:addEventListener( "collision" )

Restart.lua:

local composer = require( "composer" ) local scene = composer.newScene() function scene:create( event ) local sceneGroup = self.view end -- display ground image local ground = display.newImageRect( "ground.png", 500, 100 ) ground.x = 145; ground.y = 480 -- display logo image local logo = display.newImageRect( "logo.png", 300, 200 ) logo.x = 160 logo.y = 20 scene:addEventListener( "create", scene ) scene:addEventListener( "enter", scene ) scene:addEventListener( "exit", scene ) scene:addEventListener( "destroy", scene )

Thank you.

You have errors in restart.lua

It’s not a complete scene. You don’t end the scene:create() function and you’re missing the:  

return scene

at the end.  You also setup events that don’t exist, like “enter” and “exit”. For composer they are “show” and “hide”. You are also missing the functions for those events.

Please look at the Composer documentation and guide and use the template we provide to avoid these kinds of errors.

https://docs.coronalabs.com/api/library/composer/index.html#scene-template

https://docs.coronalabs.com/guide/system/composer/index.html#scene-template

As far as deciphering the error:
 

Runtime error
?:0: attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
        ?: in function ‘gotoScene’
        c:\users\true\documents\corona projects\test bench\main.lua:34: in funct
ion ‘_listener’
        ?: in function <?:141>
        ?: in function <?:221>

composer.gotoScene() tries to get the sceneName and is saying it’s nil.  While this particular message is technically accurate, its perhaps not the most useful message. This message generally means something is wrong with the scene and causing the scene to not compile enough that we can’t access the scene name.

Rob

 c:\users\true\documents\corona projects\test bench\main.lua:34: in funct ion '\_listener'

It might not be clear to you, but this line specifies both what file and at what line in your code that the error occured.

i.e. line 34 of your main.lua file. While this is one of the trickier error messages, it’s usually very informative.

Try just this and see if you can understand what the error message is telling you:

local xyz = 10 print(xyp + 1)

You have errors in restart.lua

It’s not a complete scene. You don’t end the scene:create() function and you’re missing the:  

return scene

at the end.  You also setup events that don’t exist, like “enter” and “exit”. For composer they are “show” and “hide”. You are also missing the functions for those events.

Please look at the Composer documentation and guide and use the template we provide to avoid these kinds of errors.

https://docs.coronalabs.com/api/library/composer/index.html#scene-template

https://docs.coronalabs.com/guide/system/composer/index.html#scene-template

As far as deciphering the error:
 

Runtime error
?:0: attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
        ?: in function ‘gotoScene’
        c:\users\true\documents\corona projects\test bench\main.lua:34: in funct
ion ‘_listener’
        ?: in function <?:141>
        ?: in function <?:221>

composer.gotoScene() tries to get the sceneName and is saying it’s nil.  While this particular message is technically accurate, its perhaps not the most useful message. This message generally means something is wrong with the scene and causing the scene to not compile enough that we can’t access the scene name.

Rob

 c:\users\true\documents\corona projects\test bench\main.lua:34: in funct ion '\_listener'

It might not be clear to you, but this line specifies both what file and at what line in your code that the error occured.

i.e. line 34 of your main.lua file. While this is one of the trickier error messages, it’s usually very informative.

Try just this and see if you can understand what the error message is telling you:

local xyz = 10 print(xyp + 1)