266 posts
Posted 26 November 2012 - 04:52 AM
Whenever I use CCLights, I may put a value in wrong. The problem is that I need a way to error the current lua thread. It would be great to use IComputerAccess to error the lua thread, but browsing the code yields no results. It would be a great feature for later use by all peripherals.
2447 posts
Posted 26 November 2012 - 06:14 AM
throw new Exception("Oh noes, we has error!");
266 posts
Posted 01 December 2012 - 02:33 PM
throw new Exception("Oh noes, we has error!");
Thanks Cloudy!
123 posts
Posted 02 December 2012 - 04:00 PM
throw new Exception("Oh noes, we has error!");
Wouldn't that error the entire game and crash it? Which would be very bad for a server (having the entire server crash because one user inputed a wrong value into a computer).
You could queue an error event (hopefully the user would see it).
510 posts
Posted 02 December 2012 - 09:10 PM
Not if you are within IPeripheral.call(). The lua machine catches the exception and propangates it as lua error.
I you are outside it, (eg in the minecraft update loop), this doesn't work of course, but who would try to launch a lua error from there anyway?
2447 posts
Posted 04 December 2012 - 06:54 AM
throw new Exception("Oh noes, we has error!");
Wouldn't that error the entire game and crash it? Which would be very bad for a server (having the entire server crash because one user inputed a wrong value into a computer).
You could queue an error event (hopefully the user would see it).
I wouldn't have suggested it had that been the case.