Sign In Register

How can we help you today?

Start a new topic
Answered

Debugging Cloud Code Module "Unknown Error"

I'm trying to get an existing js library working as a module in cloud code. Something is wrong, but I'm having a really hard time debugging it - when I step through it in the test harness, everything is going great for a while, and then suddenly it exits the debug view and the response is simply "message": "An unexpected error has occurred"


I have been trying to narrow down the error, but unfortunately, the debugger leaves a lot to be desired. Whatever this error is, it is deep in code I'm not super familiar with that works fine in both browser and more standard Node environments. 


I'm happy to dig into it myself, but I need more tools to make headway.

Is there any way that I can set up the cloud code environment locally so I could debug with a full IDE? Or a way to set the portal debugger up with breakpoints and/or a console log? Anything I can use to track down where or why this error is happening.


Best Answer

Hi Ben


The script log accessed via the manage screens will show you detailed errors triggered in your game,

You can use Spark.getLog().debug(" Error message"); to save a debug log to Script log.

You can also use the down arrow in the debugger to step into the code to debug line my line if you wish.


Regards

Katie



1 Comment

Answer

Hi Ben


The script log accessed via the manage screens will show you detailed errors triggered in your game,

You can use Spark.getLog().debug(" Error message"); to save a debug log to Script log.

You can also use the down arrow in the debugger to step into the code to debug line my line if you wish.


Regards

Katie



Login to post a comment