- the previous version posted exception errors in doPrimitive, rather than setting them in the Error via prPrimitiveErrorString as for other primitive errors. This prevented sclang try / catch from truly catching the error.
- This could be annoying in cases like network music situations, where a stream of errors resulting from another host going down could not be handled as desired even though the problem had nothing to do with SC, or even the local machine.
- this version fixes that, and makes the error message clearer and more informative
Make primitive exception handling per-PyrThread
- We cannot store exception info directly in the PyrThread, as PyrThreads are never constructed in the normal C++ sense (made in the GC pool), so we store it instead in a map in the VMGlobals instance, using the thread as a key.
- this makes it both per-thread, and supports any future implementations using multiple VMs.
Merge pull request #2876 from supercollider/fix-primitive-exception-handling
Fix SC try / catch behaviour for primitive exception errors
Control for catching exceptions in primitives is redirected to conform to the existing pattern; this avoids extra error messages that appear even when the offending code is properly wrapped in a SuperCollider try-catch block.