summaryrefslogtreecommitdiff
path: root/UError.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2010-02-05 14:47:59 +0100
committerTomas Bzatek <tbzatek@redhat.com>2010-02-05 14:47:59 +0100
commit8f1ad519dd5ae1d17f625044bf18c3d8e77acea5 (patch)
treedaf77dd7bb5c29fafbfc2cb8aeacc72a22d49a0c /UError.pas
parentbe965b1ba6d05d188ccf4eb5b9f93ca56209161c (diff)
downloadtuxcmd-8f1ad519dd5ae1d17f625044bf18c3d8e77acea5.tar.xz
Report exceptions coming from VFS
Diffstat (limited to 'UError.pas')
-rw-r--r--UError.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/UError.pas b/UError.pas
index 57250a8..6734367 100644
--- a/UError.pas
+++ b/UError.pas
@@ -21,7 +21,7 @@ unit UError;
interface
-uses glib2, gtk2, Classes, ULibc, GTKForms;
+uses glib2, gtk2, Classes, SysUtils, ULibc, GTKForms;
// Ported from gioerror.h
@@ -68,11 +68,13 @@ function G_IO_ERROR: TGQuark;
function g_io_error_from_errno(err_no: gint): GIOErrorEnum;
+procedure g_set_error_from_exception(Error: PPGError; E: Exception);
+
procedure ShowError(Parent: TCustomGTKForm; const Text: string; Error: PGError);
implementation
-uses SysUtils, UCoreUtils, UGnome;
+uses UCoreUtils, UGnome;
(********************************************************************************************************************************)
@@ -115,6 +117,12 @@ end;
(********************************************************************************************************************************)
+procedure g_set_error_from_exception(Error: PPGError; E: Exception);
+begin
+ g_set_error(Error, G_IO_ERROR, integer(G_IO_ERROR_FAILED), 'Exception raised: %s', PChar(E.Message));
+end;
+
+(********************************************************************************************************************************)
procedure ShowError(Parent: TCustomGTKForm; const Text: string; Error: PGError);
var Dialog: PGtkWidget;
error_str: PChar;