Primitive error codes
All errors reported by VA Smalltalk are found in the pool dictionary named SystemPrimitiveErrors. To determine the cause of a particular error, use:
SystemPrimitiveErrors keyAtValue: errorNumber
In some cases, the error reported is 18 which is OSError. This indicates that an OSError occurred during some primitive or system initialization. In the case of image startUp, OSError 18 indicates that reading the image file resulted in an error.
Applications can return error codes from Smalltalk using the following code:
System exit: errorCode withObject: returnObject
errorCode should be a SmallInteger whose possible values are described below. returnObject, which can be used to provide additional debugging information when running with a debugging virtual machine, should normally be nil.
The error codes shown below can be returned from the API functions or displayed in a Fatal Application Error dialog box.
Users can add new error codes with values above EsPrimErrMinUserError. User error codes from 9000 through 9099 will suppress the display of the Fatal Application Error dialog box.
Table 39. User Primitive Error Codes
Error Code
Value
Description
EsPrimErrNoError
0
No error occurred
EsPrimErrInvalidClass
1
An object did not have the correct type (class)
EsPrimErrIndexOutOfRange
2
An index was out of range
EsPrimErrNotIndexable
3
An object that must be indexable was not
EsPrimErrValueOutOfRange
4
A value was out of range
EsPrimErrReadOnly
5
An object was read-only and nothing could be stored into it
EsPrimErrSignedNotDefined
6
Signed operations are not defined for an object
EsPrimErrFPOverflow
7
Floating point overflow occurred in the primitive
EsPrimErrFPDomainError
8
Floating point domain error
EsPrimErrFPGeneralError
9
Other floating point errors
EsPrimErrDivideByZero
10
Divide by zero attempted
EsPrimErrInvalidSize
11
An object did not have the correct size
EsPrimErrNotEnoughMemory
12
There was not enough memory to allocate an object
EsPrimErrUnknownAPIType
15
The calling convention specified in the PlatformFunction is not supported
EsPrimErrUnknownConversionType
16
The conversion type specified in the PlatformFunction is not supported
EsPrimErrInvalidArgCount
17
Invalid argument count to the primitive
EsPrimErrOSError
18
An operating system error occurred (for EsPrimErrOSError, return the operating system error code in the argumentNumber field of ESPrimFail)
EsPrimErrProcessDead
19
Invalid operation for a dead process
EsPrimErrProcessActive
20
Invalid operation for the active process
EsPrimErrUnboundFunction
22
Attempt to call an unbound PlatformFunction
EsPrimErrUnimplementedPrimitive
23
Primitive is not yet implemented
EsPrimErrInvalidInCallback
24
Invalid operation in a callback into the interpreter
EsPrimErrCannotReturn
25
Attempt to return twice from a method
EsPrimErrDebugNotSupported
26
No debug operations are supported
EsPrimErrDNURecursion
27
doesNotUnderstand: is not understood
EsPrimErrProcessTerminatedDuring- CallIn
28
Active process terminated during a callback
EsPrimErrStackOverflow
29
The Smalltalk stack has overflowed
EsPrimErrInvalidReftype
30
An invalid OSObject reftype
EsPrimErrInvalidReference
31
An invalid OSObject reference
EsPrimErrInvalidOffset
32
An invalid OSObject offset
EsPrimErrImageFileOpenError
33
Could not open image file. Additional information about the cause of this error is written to the log file.
EsPrimErrImageReadError
34
Read error occurred while loading image
EsPrimErrMaxMemorySegments- Exceeded
35
Maximum number of memory segments exceeded
EsPrimErrRSGrowFail
36
RememberedSet grow failed
EsPrimErrImageFileInvalid
37
Image file is not an image
EsPrimErrSupportDLLMissing
38
A required DLL cannot be located
EsPrimErrInternalError
39
An unspecified internal error has occurred
EsPrimErrMaxImagesSavesExceeded
40
*unused*
EsPrimErrAsyncQueueOverrun
41
The async message queue has overflowed
EsPrimErrNMI
42
NMI has occurred
EsPrimErrUnimplementedByteCode
43
An unimplemented bytecode was executed
EsPrimErrImageSaveError
44
An error occurred during image save
EsPrimErrInvalidAsyncMessage
45
An invalid async message was posted
EsPrimErrDecimalError
46
An error occurred in the decimal math library
EsPrimErrDecimalPrecisionScale- Mismatch
47
Precision must be greater than scale
EsPrimErrDecimalInvalidScale
48
Scale must be positive
EsPrimErrDecimalInvalidPrecision
49
Precision must be strictly positive
EsPrimErrDecimalPrecisionOverflow
50
Precision exceeds the maximum
EsPrimErrInvalidMemorySegment
51
Not valid memory segment specified
EsPrimErrGPF
52
General protection fault
EsPrimErrGPFInvalidRead
53
General protection fault-read from invalid memory location
EsPrimErrGPFInvalidWrite
54
General protection fault-write to invalid memory location
EsPrimErrGPFInvalidInstruction
55
General protection fault-invalid instruction executed
EsPrimErrOutOfScopeReturnFrom- CallIn
56
Attempt to return out of scope over a call in -- A return was attempted from a block would require the stack be unwound through a C callback. This disallowed and the error code returned to the sender of EsSendMessage.
EsPrimErrNoMoreEntryPoints
57
All available esEntryPoint addresses are in use.
EsPrimErrInvalidRelocation
58
Invalid image relocation -- The image is corrupt and invalid addresses were discovered during image load. The image load was aborted.
EsPrimErrFPUnderflow
59
Floating point underflow ocurred.
EsPrimErrExitDueToWalkback
60
Exit due to walkback -- The EsImageStart>>#ExitAfterWalkback flag was set to true and the image exited after printing the walkback to the log file. See the method EsImageStartUp>>#outputWalkback:on:process: for more information.
EsPrimErrEvaluationTimeLimitExpired
61
*unused*
EsPrimErrExitDueToStackDump
62
Exit due to error with stack dump provided. -- A postmortem stack dump was created. An error occurred and a stack dump was created for use by the postmortem debugger (Reference XD Debugger doc).
EsPrimErrMinUserError
8192
Users can add new error codes above this value
 
Last modified date: 01/29/2015