Browse Source

* Add some missing exception classes

Michaël Van Canneyt 1 year ago
parent
commit
6eac18e8c1
2 changed files with 31 additions and 0 deletions
  1. 16 0
      rtl/objpas/sysutils/sysutilh.inc
  2. 15 0
      rtl/objpas/sysutils/sysutils.inc

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

@@ -214,6 +214,7 @@ type
    EInvalidInsert = class(Exception);
 
    EPackageError = class(Exception);
+   ECFError = class(Exception);
 
    EOSError = class(Exception)
    public
@@ -226,6 +227,12 @@ type
    ENoDynLibsSupport = class(Exception);
 
    EProgrammerNotFound = class(Exception);
+   
+   EMonitor = class(Exception);
+   EMonitorLockException = class(EMonitor);
+   ENoMonitorSupportException = class(EMonitor);   
+
+   EObjectDisposed = class(Exception);
 
    ENotImplemented = class(Exception);
 
@@ -239,11 +246,20 @@ type
    EFileNotFoundException = class(Exception);
    EPathNotFoundException = class(Exception);
 
+   EInOutArgumentException = class(EArgumentException)
+   public
+     Path: string;
+     constructor Create(const aMsg, aPath: string); overload;
+     constructor CreateRes(ResStringRec: PResStringRec; const aPath: string); overload;
+   end;
+
    EInvalidOpException = class(Exception);
 
    ENoConstructException = class(Exception);
    EListError = Class(Exception);
 
+   EOperationCancelled = class(Exception);
+
    { Exception handling routines }
    function ExceptObject: TObject;
    function ExceptAddr: CodePointer;

+ 15 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -305,6 +305,21 @@ end;
        ErrCode:=Code;
     end;
 
+  
+constructor EInOutArgumentException.Create(const aMsg, aPath: string); overload;
+
+begin
+  Path:=aPath;
+  Inherited Create(aMsg);
+end;
+
+constructor EInOutArgumentException.CreateRes(ResStringRec: PResStringRec; const aPath: string); overload;
+
+begin
+  Path:=aPath;
+  Inherited CreateRes(ResStringRec);
+end;
+
 {$if defined(win32) or defined(win64) or defined (wince)}
 function EExternal.GetExceptionRecord: PExceptionRecord;
 begin