diff options
| author | Tomas Bzatek <tbzatek@redhat.com> | 2010-02-05 14:47:59 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@redhat.com> | 2010-02-05 14:47:59 +0100 |
| commit | 8f1ad519dd5ae1d17f625044bf18c3d8e77acea5 (patch) | |
| tree | daf77dd7bb5c29fafbfc2cb8aeacc72a22d49a0c /UError.pas | |
| parent | be965b1ba6d05d188ccf4eb5b9f93ca56209161c (diff) | |
| download | tuxcmd-8f1ad519dd5ae1d17f625044bf18c3d8e77acea5.tar.xz | |
Report exceptions coming from VFS
Diffstat (limited to 'UError.pas')
| -rw-r--r-- | UError.pas | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; |
