Marcel Taeumel uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-mt.1453.mcz
==================== Summary ====================
Name: System-mt.1453 Author: mt Time: 17 April 2024, 10:43:17.752706 am UUID: d5ecd791-4890-e748-950c-809da8376186 Ancestors: System-mt.1452
For structured primitive errors, expose #errorName in its print-string to make the error table more readable (see index 52 in #specialObjectsArray).
While ExceptionInFFICallError has both a custom name and an extra slot, you can use any custom instance of PrimitiveError to pass scoped error codes from failing primitives such as the existing #'operating system error' and its platform-specific error codes. However, you would need to reserve a new index in the error table and thus update the special-objects array. Therefore, custom VM plugins might want to choose an extra interface to communicate failed operations.
For example, SqueakFFI uses #getLastError and #externalCallFailed to fabricate readable error messages. Not sure why we do it this way (see #ffiFail: in plugin code) ... the approach via PrimitiveError seems more elegant to me... and via PrimErrFFIMarshallingError there is even a way to use the new scheme. :-)
=============== Diff against System-mt.1452 ===============
Item was added: + ----- Method: PrimitiveError>>printOn: (in category 'printing') ----- + printOn: aStream + + self errorName + ifNil: [super printOn: aStream] + ifNotNil: [:nm | nm printOn: aStream].!
squeak-dev@lists.squeakfoundation.org