Is it normal for most syntax errors to crash the simulator without error?

For example, if I try to call a function that doesn't exist, the playdate simulator simply hangs, with no errors printed to the console or anything. This can make debugging more or less a guessing game. I know Lua doesn't really do exception handling in the traditional sense but I'm wondering if something in my setup is wrong?

I'm on a mac with VS Code installed. I have both of the playdate extensions installed:

(this is because one of them seemed to only work for syntax highlighting and one only works for the debugger).

I also tried on Nova, and had the same things happen, where the playdate simulator just hangs with no errors. Everytime this happend I have to force close the simulator.

Any tips for making my life easier would be appreciated! :slight_smile:

I've had that happen a lot when I have a typo in a name, or accidentally copy/pasted only part of it. Not a daily occurrence, but sommon enough that an error message with a line number would be great to have!

(But I would say by far MOST errors for me do have an error message and exit cleanly without the Simulator crashing. I use Nova.)

Are you sure it's not the debugger freezing things at the error? Error messages should be in debugger.

When I'm hitting this issue in Nova I disable breakpoints, which reverts to the more standard error messages in Simulator console.

2 Likes

Ahh, yeah seems like it was the debugger that hangs, not the simulator. I tried running the .pdx manually and I was able to get an error message. This has saved me so many headaches, thank you!

1 Like

The errors should be logged in the console of both Nova and VSCode before the debugger is stopped. However you have to be on that tab to notice them. Also, you can disable exception breakpoints to have the error handled in the Sim only. Hope this helps a bit. Note you have to be on the 1.13.x SDK for this behavior.

1 Like