Don't crash the entire UdonBehaviour when an exception is thrown
FairlySadPanda
If an exception is thrown by a call made by a Udon program, the instigating event should be terminated with a clean error message, rather than permanently crashing the entire behaviour.
In addition, an OnException(error) event which contains the exception object thrown for handling when things explode would be extremely handy.
Log In
Momo the Monster
Merged in a post:
Log the name of the game object and program asset that threw an exception in game
Merlin
At the moment we have no way of knowing which object or Udon script in the scene has thrown an exception when we are in game since it's not logged to the console.
It would be nice to have the name of the game object that threw the exception and the name of the Udon script on that object so that we could find issues more easily when we have more than a few scripts in our scene. It might also be useful to include the name of the serialized program asset so that there isn't ambiguity if someone has multiple scripts named the same thing.
More detailed debugging info would be useful at a later point, but having the name of the object and script throwing the error would be very useful in the meantime.
Momo the Monster
Merged in a post:
Provide some way to check if an Udon Behaviour has had an exception.
Junii23
At the moment, there's no reliable way for an Udon behaviour to check if another Udon Behaviour has had an exception that caused it to crash.
This would be very handy to, say, check all the Udons are OK before starting a round in a game. Or to have an in-game debug menu that easily showed if any Udon's have had an exception without needing to check the logs.
At the moment, the only way to tell if an Udon Behaviour has had an exception is via the logs, or by checking if the behaviour is disabled without you disabling it. Checking via logs isn’t very user-friendly, and checking if the behaviour is disabled isn’t always reliable if you are constantly turning it on and off for other reasons.
Maybe Utilities.IsValid(someUdonBehaviour) could return false if ‘someUdonBehaviour’ has had an exception? Or perhaps an event like ‘OnUdonException(UdonBehaviour udon)’ that’s called on every Udon Behaviour when there has been an Udon Exception?
Momo the Monster
Merged in a post:
More Error/Exception info
PhaxeNor
Current error and exception in the console only shows that something happened, but doesn't really tell you where or with what node it happened with.
Would be nice if we could get more information so it's easier to find bugs that are either user errors or from the game.
ReadyPlayerEmma
Yes please! I would very much like to have this. Preferably having actual exception handing would be best. Udon gives the ability to make very complex game logic within worlds now. Having the tools to make sure it doesn't break easily will allow the best experiences for players.
Reimajo
We have a scene with >70 different UdonBehaviours on >100 different GameObjects and this feature is absolutely needed, since "An UdonBehaviour crashed" is nothing we can work with to identify an issue.
We're wasting a lot of time trying to make out what causes an issue, time that we could also use to actually create something new instead.
It would be very good to get the function name which caused the issue as well, but even just knowing the script name would already be a huge improvement.