Re: Response for PING in ircbot.

2021-02-02 Thread Random832
On Sat, Jan 30, 2021, at 11:50, Bischoop wrote: > > Got problem with responding for Ping, tried so many ways to response > and always end up with time out or other error. This time: 1. It looks like you're forgetting to send \n\r 2. i'm not sure if the server ping is guaranteed to have : characte

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Greg Ewing
On 3/02/21 9:24 am, Dan Stromberg wrote: But how do you know what exceptions could be raised? Mostly I find that it's not really necessary to know precisely which exceptions could be raised. The way I usually deal with exceptions is: 1. If it descends from OSError, I assume it results from s

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Barry Scott
> On 2 Feb 2021, at 20:24, Dan Stromberg wrote: > > > > On Tue, Feb 2, 2021 at 12:00 PM Barry Scott > wrote: > When I write packages I aim to trap the exceptions from the lower levels > and convert into a package specific exceptions or document that a low > l

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Chris Angelico
On Wed, Feb 3, 2021 at 7:26 AM Dan Stromberg wrote: > > On Tue, Feb 2, 2021 at 12:00 PM Barry Scott wrote: > > > When I write packages I aim to trap the exceptions from the lower levels > > and convert into a package specific exceptions or document that a low > > level exception can propagate. >

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Dan Stromberg
On Tue, Feb 2, 2021 at 12:00 PM Barry Scott wrote: > When I write packages I aim to trap the exceptions from the lower levels > and convert into a package specific exceptions or document that a low > level exception can propagate. > But how do you know what exceptions could be raised? I love Pyt

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Barry Scott
> On 2 Feb 2021, at 00:54, Skip Montanaro wrote: > > I'm curious if there are best practices for handling exceptions raised > by lower level modules and packages. For example, I wrote an > application called polly[1] which constructs a personalized dictionary > from email messages using IMAP4.

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Terry Reedy
On 2/1/2021 7:54 PM, Skip Montanaro wrote: However... Network applications being what they are, hiccups are going to happen. In the time since I swapped in the imapclient package, I've also had to catch exceptions raised by lower level modules/packages I wasn't using directly, discovering them o

Re: Best practice for handling exceptions raised at lower levels?

2021-02-02 Thread Antoon Pardon
Op 2/02/21 om 01:54 schreef Skip Montanaro: Here's the crux of the problem. Where does responsibility generally fall for low level exception handling? I don't mean to pick on IMAPClient. It's just a recent example and got me thinking about the problem. Is it (generally) the responsibility of the