Browse Source

* added conditional possibility of displaying the last OS error in information displayed for unhandled exceptions

git-svn-id: trunk@29622 -
Tomas Hajny 10 years ago
parent
commit
329f788f58
1 changed files with 6 additions and 1 deletions
  1. 6 1
      rtl/objpas/sysutils/sysutils.inc

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

@@ -297,7 +297,12 @@ begin
   else if Obj is TObject then
     Writeln(hstdout^,'Exception object ',Obj.ClassName,' is not of class Exception.')
   else
-    Writeln(hstdout^,'Exception object is not ia valid class.');
+    Writeln(hstdout^,'Exception object is not a valid class.');
+{$IFDEF HAS_OSERROR}
+ {$IFDEF DEBUG_EXCEPTIONS_LASTOSERROR}
+  WriteLn (HStdOut^, 'Last OS error detected in the RTL: ', GetLastOSError);
+ {$ENDIF DEBUG_EXCEPTIONS_LASTOSERROR}
+{$ENDIF HAS_OSERROR}
   Writeln(hstdout^,BackTraceStrFunc(Addr));
   if (FrameCount>0) then
     begin