[fpc-devel] SysUtils exception translation issues

Vinzent Hoefler JeLlyFish.software at gmx.net
Mon Oct 22 11:40:49 CEST 2007


Hi all,

after we had that quite heated discussion in core, I decided to take 
matters into my own hand and come up with some useful proposal. But now 
I am looking at fpc2.2.0 sources for SysUtils and feel quite desperate. 
The thing is that I don't know if those are actual bugs, design 
decisions, or Delphi compatibility issues:

1) Strangely, runtime error 1 (invalid function number) is translated to 
EOutOfMemory.

2) Translation to I/O errors: there's a string set for RTE15, although 
it's not even handled by the case statement, as well as RTE 16 to 18, 
and 104, which are not handled neither.

3) Most DOS-specific errors are not handled at all (see RTE150 - 162).

4) RTE 202 (Stack check error), and RTE210 (object not initialized) are 
not handled.

5) RTE206 is translated to EOverflow, although there is an EUnderflow 
exception type.

6) RTE212 (stream registration error) is translated to an EExternal 
exception, although EExternal should probably not be raised on its own, 
but rather provide as base class for real "external" error situations.

7) RTE213 again is not handled, while RTE214 (collection overflow error) 
suddenly becomes an EBusError.

8) Why is RTE217 (unhandled exception) translated to EControlC?

9) RTE220 - 225 are not documented as Variant errors.


For me it looks as if the runtime error to exception translation is more 
or less screwed anyway.


Vinzent.



More information about the fpc-devel mailing list