ID:155728
 
Is it possible to pass runtime error messages through a proc and modify the output? At times when I am debugging, I would like to be able to add extra info to the error output that would only be displayed if the proc crashed. I don't see how it could be done but maybe someone has an idea.
If there is a part of your code that is prone to crashing (and you can't prevent it yourself for some reason), you can place it in a separate function that returns 1 on completion. Then, you just have to check if that function returns null to know if it crashed or not.

You can initiate a crash yourself with a custom message by calling CRASH().

The only way I can think of to access the actual runtime message is to set the log to a text file, and parse it after the crash (although you might have to sleep to give DS a chance to write the error). My original static lighting generator used this method to watch for "maximum number of rsc entries exceeded" errors.