-
• #2
I'm thinking about adding something like error number since started. If you can detect that it is the same error/exception, then just printing the new error number with the number of first occurrence. Since the numbers is incrementing you also get a *feel of 'distance' between same errors. Using some kind of a threshold - general or per individual interval (id) when specified - and the error occurrence could trigger an event with context information (interval id? and) what is suitable and let the app handle it the application overrides a default behavior, which would be killing specific/all interval/s. (Is that a similar issue pattern you find in the browser when the user gets presented the option to choose/confirm Don't show this alert/message pop-up anymore? ? Of course, in Espruino context we do not have a user...).
It's been a longstanding annoyance for me that you can do something like:
and can generate a whole stream of exceptions on the console. It's not a big deal for USB-connected devices, but for Puck.js printing that amount of data swamps everything else.
Generally this doesn't happen too much, but if you're changing code using the REPL and you make a typo in a function called from an interval then it's really annoying.
At the moment, if you hit Ctrl-C a few times generally you can get it to cancel the interval with the error, but it's still a pain.
Node.js cancels an interval the very first time there's an exception, but personally I don't think you want that because you might have some code in production that fails one in 100 times, but you want it to keep running regardless.
Any thoughts on how to deal with this?