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,83575a3c82229268 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-05 15:30:11 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Exceptions vs Error return values References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Sun, 05 Aug 2001 22:30:11 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 997050611 24.7.82.199 (Sun, 05 Aug 2001 15:30:11 PDT) NNTP-Posting-Date: Sun, 05 Aug 2001 15:30:11 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:11329 Date: 2001-08-05T22:30:11+00:00 List-Id: > I'm currently trying to get to grips with winsock programming. As > part of this process I'm trying to put together a slightly higher > level binding to the thin one provided with Gnat. > ... > Would it be a sensible guideline to relate the use of exceptions to > the severity of error (for example as described in table below)? In Claw.Sockets (www.rrsoftware.com) we aways raise an exception. There are a very few standard ones, eg. Busy_Error, Not_Valid_Error, Not_Found_Error, but a lot of things raise Windows_Error. In that case there's a routine you call to get the specific error code - normally, but not always, in 10004 .. 11004. > 1 Winsock hasn't been initialised by a call to WSAStartup, or when Claw.Sockets also tries to reduce the number of possible errors. For instance, it automatically does the WSAStartup call the first time you do something with winsock, and a Finalize routine cleans up.