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
C
Customer Support
said
almost 4 years ago
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
Customer Support
said
almost 4 years ago
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.
Ben Batstone
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.
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
Customer Support
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
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics