Delphi run-time errors
Posted by jpluimers on 2021/07/29
Since I always forget where to get the full list: there is none in the documentation. Only parts.
Usually the mapping is from run-time errors to exceptions:
In addition, exceptions are converted to run-time errors when the exception handling mechanism in the SysUtils
unit is not up.
This can happen early in start-up, or late un shut-down of an application.
The one I encountered most is the runtime error 216 during shutdown: it is an Access Violation (EAccessViolation).
Run-time errors (not changed since Delphi 2007)
- [WayBack] Delphi 2007: Exceptions
When an application uses the
SysUtils
unit, most runtime errors are automatically converted into exceptions. Many errors that would otherwise terminate an application – such as insufficient memory, division by zero, and general protection faults – can be caught and handled. - [WayBack] Delphi 2007: Delphi Runtime Errors
Runtime errors take the form:
Runtime error nnn at xxxxxxxx
where
nnn
is the runtime error number, andxxxxxxxx
is the runtime error address.Applications that use the SysUtils class map most runtime errors to Exceptions, which allow your application to resolve the error without terminating.
Delphi runtime errors are divided into the following categories:
- I/O errors, numbered 100 through 149
- Fatal errors, numbered 200 through 255
- Operating system errors
- [WayBack] Delphi 2007: I/O Errors
I/O errors cause an exception to be thrown if a statement is compiled in the
{$I+}
state. (If the application does not include theSysUtils
class, the exception causes the application to terminate).In the
{$I-}
state, the program continues to execute, and the error is reported by theIOResult
function.NumberNameDescription100Disk read errorReported by Read on a typed file if you attempt to read past the end of the file.101Disk write errorReported by CloseFile, Write, WriteIn, or Flush if the disk becomes full.102File not assignedReported by Reset, Rewrite, Append, Rename, or Erase if the file variable has not been assigned a name through a call to Assign or AssignFile.103File not openReported by CloseFile, Read Write, Seek, Eof, FilePos, FileSize, Flush, BlockRead, or BlockWrite if the file is not open.104File not open for inputReported by Read, Readln, Eof, Eoln, SeekEof, or SeekEoln on a text file if the file is not open for input.105File not open for outputReported by Write or Writeln on a text file if you do not generate a Console application.106Invalid numeric formatReported by Read or Readln if a numeric value read from a text file does not conform to the proper numeric format. - [WayBack] Delphi 2007: Fatal errors
NumberNameException200Division by zeroEDivByZero201Range check errorERangeError202Stack overflowEStackOverflow203Heap overflow errorEOutOfMemory204Invalid pointer operationEInvalidPointer205Floating point overflowEOverflow206Floating point underflowEUnderflow207Invalid floating point operationEInvalidOp210Abstract Method ErrorEAbstractError215Arithmetic overflow (integer only)EIntOverflow216Access violationEAccessViolation217Control-CEControlC218Privileged instructionEPrivilege219Invalid typecastEInvalidCast220Invalid variant typecastEVariantError221Invalid variant operationEVariantError222No variant method call dispatcherEVariantError223Cannot create variant arrayEVariantError224Variant does not contain arrayEVariantError225Variant array bounds errorEVariantError226TLS initialization errorNo exception to map to.227Assertion failedEAssertionFailed228Interface Cast ErrorEIntfCastError229Safecall errorESafecallException230Unhandled exceptionNo exception to map to.231Too many nested exceptionsUp to 16 permitted.232Fatal signal raised on a non-Delphi threadNo exception to map to.
For completeness, some DOS Borland/Turbo Pascal errors from [WayBack] where are the runtime error codes, eh? – delphi
Borland Pascal 7 runtime errors; most applicable to Delphi:
*** DOS ***
1 Invalid function number
2 File not found
3 Path not found
4 Too many open files
5 File access denied
6 Invalid file handle
12 Invalid file access code
15 Invalid drive number
16 Cannot remove current directory
17 Cannot rename across drives
18 No more files
*** I/O ***
100 Disc read error
101 Disc write error
102 File not assigned
103 File not open
104 File not open for input
105 File not open for output
106 Invalid numeric format read from file
*** CRITICAL ***
150 Write protected
151 Unknown unit/Bad drive request struct length
152 Drive not ready
153 Unknown command
154 CRC error in data
155 Bad drive request structure length
156 Disc seek error
157 Unknown media type
158 Sector not found
159 Printer out of paper
160 Device write fault
161 Device read fault
162 Hardware failure (C-DOS: file/device opened by another process)
*** FATAL ***
200 Division by zero
201 Range check
202 Stack overflow (on entry to a procedure or function)
203 Heap overflow (from New() or GetMem())
204 Invalid pointer operation (from Dispose() or FreeMem())
205 Floating point overflow
206 Floating point underflow
207 Invalid floating point operation
208 Overlay manager not installed (usually when calling OvrInit)
209 Overlay file read error
210 Object not initialized
211 Call to abstract method
212 Stream registration error
213 Collection index out of range
214 Collection overflow error
215 Arithmetic overflow error
216 General Protection fault
The run-time error 216
- [WayBack] Delphi Runtime error 216 thrown in SysUtils.FinaliseUnits, line number not in mapfile – Stack Overflow
- [WayBack] madshi.net • View topic – Runtime Error 216
–jeroen
Leave a comment