From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d8a4797a79f9c90f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-26 07:29:09 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeeds.sol.net!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: I/O - exception handling Date: Mon, 26 May 2003 14:29:08 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1053959348 24149 129.241.83.78 (26 May 2003 14:29:08 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 26 May 2003 14:29:08 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:37787 Date: 2003-05-26T14:29:08+00:00 List-Id: 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; -- Preben Randhol http://www.pvv.org/~randhol/