Browse Source

Added exception EObjectCheck for object reference check (runtime error 210).

rtl/objpas/sysconst.pp:
  + add resourcestring SObjectCheckError
rtl/objpas/sysutilh.inc:
  + add new Exception descendant EObjectCheck
rtl/objpas/sysutils.inc:
  + use EObjectCheck with message SObjectCheckError for runtime error 210

git-svn-id: trunk@23656 -
svenbarth 12 years ago
parent
commit
db6385ef33
3 changed files with 4 additions and 1 deletions
  1. 1 0
      rtl/objpas/sysconst.pp
  2. 1 0
      rtl/objpas/sysutils/sysutilh.inc
  3. 2 1
      rtl/objpas/sysutils/sysutils.inc

+ 1 - 0
rtl/objpas/sysconst.pp

@@ -82,6 +82,7 @@ resourcestring
   SNoThreadSupport       = 'Threads not supported. Recompile program with thread driver.';
   SMissingWStringManager = 'Widestring manager not available. Recompile program with appropriate manager.';
   SSigQuit               = 'SIGQUIT signal received.';
+  SObjectCheckError      = 'Object reference is Nil';
   SOSError               = 'System error, (OS Code %d):'+LineEnding+'%s';
   SOutOfMemory           = 'Out of memory';
   SOverflow              = 'Floating point overflow';

+ 1 - 0
rtl/objpas/sysutils/sysutilh.inc

@@ -189,6 +189,7 @@ type
    EAbort           = Class(Exception);
    EAbstractError   = Class(Exception);
    EAssertionFailed = Class(Exception);
+   EObjectCheck     = Class(Exception);
 
    EPropReadOnly = class(Exception);
    EPropWriteOnly = class(Exception);

+ 2 - 1
rtl/objpas/sysutils/sysutils.inc

@@ -351,7 +351,7 @@ type
   end;
 
 const
-  exceptmap: array[0..27] of TExceptMapEntry = (
+  exceptmap: array[0..28] of TExceptMapEntry = (
     (code: 200; cls: EDivByZero;     msg: @SDivByZero),
     (code: 201; cls: ERangeError;    msg: @SRangeError),
     (code: 202; cls: EStackOverflow; msg: @SStackOverflow),
@@ -360,6 +360,7 @@ const
     (code: 207; cls: EInvalidOp;     msg: @SInvalidOp),
     { Delphi distinguishes reDivByZero from reZeroDivide, but maps both to code 200. }
     (code: 208; cls: EZeroDivide;    msg: @SZeroDivide),
+    (code: 210; cls: EObjectCheck;   msg: @SObjectCheckError),
     (code: 211; cls: EAbstractError; msg: @SAbstractError),
     (code: 212; cls: EExternalException; msg: @SExternalException),
     (code: 214; cls: EBusError;      msg: @SBusError),