Custom module primitive error codes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Custom module primitive error codes

monty-3
 
#primitiveFailFor: can be used to signal a primitive failure with an integer error code. The VM can map a small set of these codes to symbols like #'bad argument' that can be checked for in <primitive:...error:> methods.

How should a module primitive use #primitiveFailFor: with its own custom error codes, so that they don't collide with the VM's current and future set of PrimErr* codes? This RSqueak issue says to use negative integers for application-specific errors: https://github.com/HPI-SWA-Lab/RSqueak/issues/130

Is that preferred for modules?