From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Re: I/O - exception handling
Date: Mon, 26 May 2003 14:31:02 +0000 (UTC)
Date: 2003-05-26T14:31:02+00:00 [thread overview]
Message-ID: <slrnbd498h.523.randhol+abuse@kiuk0152.chembio.ntnu.no> (raw)
In-Reply-To: slrnbd494u.523.randhol+abuse@kiuk0152.chembio.ntnu.no
Preben Randhol wrote:
> Sergey Koshcheyev wrote:
>>> In stead of when others => why don't you check which exception
>>> occurred?
>>>
>>> You have Name_Error, Use_Error, Device_Error, End_Error etc...
>>
>> For simplicity - currently it's enough for me just to know that something
>> failed. And besides, I don't think it would solve the problem, even if I
>> checked for specific exceptions.
>
> Well I don't know what you are doing, but I would have checked so I
> could give some feedback as to what the problem is.
>
>
> I do this check in my application so the user can get propper feedback:
>
>
> exception
> when Name_Error =>
> Dialogs.Warning
> (Title => -"Could not find file",
> Message => -"The file you requested :" & ASCII.LF &
> ASCII.LF & filename & ASCII.LF & ASCII.LF &
> (-"Could not be found. Please check that "&
> "you spelt the filename correctly."),
> Has_Main => True);
>
> when Use_Error =>
> Dialogs.Warning
> (Title => -"Could not open file",
> Message => -"The file you requested :" & ASCII.LF &
> ASCII.LF & filename & ASCII.LF & ASCII.LF &
> (-"Could not be opened. Please check that "&
> "you have permission to read this file."),
> Has_Main => True);
>
> when Device_Error | End_Error =>
> Dialogs.Warning
> (Title => -"Could not open file",
> Message => -"The file you requested :" & ASCII.LF &
> ASCII.LF & filename & ASCII.LF & ASCII.LF &
> (-"Could not be opened. Please check that "&
> "it is a valid file."),
> Has_Main => True);
> when E : others =>
> Dialogs.Error_Report
> (Error =>
> (-"An unexpected error occurred while trying to open ") &
> ASCII.LF & ASCII.LF & filename &
> ASCII.LF & ASCII.LF & "Please Report this!" &
> ASCII.LF & ASCII.LF & Exception_Information (E));
> end;
Actually this is some old code as I rewrote it to use enumerations
later.
--
Preben Randhol http://www.pvv.org/~randhol/
next prev parent reply other threads:[~2003-05-26 14:31 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-26 13:05 I/O - exception handling Sergey Koshcheyev
2003-05-26 13:33 ` Preben Randhol
2003-05-26 14:11 ` Sergey Koshcheyev
2003-05-26 14:29 ` Preben Randhol
2003-05-26 14:31 ` Preben Randhol [this message]
2003-05-26 14:39 ` Sergey Koshcheyev
2003-05-26 16:57 ` Preben Randhol
2003-05-26 17:48 ` Sergey Koshcheyev
2003-05-26 18:08 ` Preben Randhol
2003-05-26 18:48 ` Sergey Koshcheyev
2003-05-27 1:24 ` Hyman Rosen
2003-05-27 2:20 ` Larry Kilgallen
2003-05-27 2:38 ` Hyman Rosen
2003-05-27 16:17 ` Warren W. Gay VE3WWG
2003-05-27 19:40 ` Hyman Rosen
2003-05-27 20:18 ` Warren W. Gay VE3WWG
2003-05-27 10:31 ` Larry Kilgallen
2003-05-27 21:43 ` Hyman Rosen
2003-05-27 5:33 ` Robert I. Eachus
2003-05-27 13:53 ` Preben Randhol
2003-05-27 12:01 ` Lutz Donnerhacke
2003-05-26 14:12 ` Simon Wright
2003-05-26 14:24 ` Preben Randhol
2003-05-26 14:52 ` Jean-Pierre Rosen
2003-05-26 15:26 ` Sergey Koshcheyev
2003-05-26 15:45 ` Hyman Rosen
2003-05-26 16:25 ` Sergey Koshcheyev
2003-05-27 1:35 ` Hyman Rosen
2003-05-28 21:47 ` Robert A Duff
2003-05-26 16:31 ` Steve
2003-05-27 2:36 ` Anisimkov
2003-05-27 7:21 ` Sergey Koshcheyev
2003-05-27 13:47 ` Preben Randhol
2003-05-27 19:01 ` Sergey Koshcheyev
2003-05-27 16:50 ` Dmitriy Anisimkov
2003-05-27 18:11 ` Ludovic Brenta
2003-05-28 1:27 ` Jeffrey Carter
2003-05-28 7:33 ` Sergey Koshcheyev
2003-05-28 9:08 ` Preben Randhol
2003-05-28 18:07 ` Randy Brukardt
2003-05-28 22:51 ` Robert I. Eachus
2003-05-29 2:03 ` Jeffrey Carter
2003-05-29 8:39 ` Manuel Collado
2003-05-30 6:56 ` Preben Randhol
2003-05-30 9:33 ` Larry Kilgallen
2003-05-30 11:13 ` Preben Randhol
2003-05-30 11:39 ` Larry Kilgallen
2003-05-30 11:41 ` Preben Randhol
2003-05-30 19:51 ` Randy Brukardt
2003-06-01 16:08 ` Robert I. Eachus
2003-06-03 0:18 ` Randy Brukardt
2003-06-03 4:16 ` Robert I. Eachus
[not found] ` <slrnbd6m69.vh.lutz@taranis.iks-jena.de>
2003-05-27 14:06 ` Preben Randhol
2003-05-27 15:59 ` Lutz Donnerhacke
2003-05-27 19:05 ` Sergey Koshcheyev
2003-05-27 19:32 ` Larry Kilgallen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox