Skip Menu |

This queue is for tickets about the Net-SSH-Perl CPAN distribution.

Report information
The Basics
Id: 2675
Status: resolved
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: Nobody in particular
Requestors: me [...] padamj.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.23
Fixed in: (no value)



Subject: Failed connection aborts script
Details: Distributions: Net-SSH-Perl-1.23 Perl Version : v5.6.1 built for i386-linux OS: Linux xxx 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST 2003 i686 unknown Problem: If the connection fails because of any reason, the script dies, where as it should report the error and allow the error to be handled by the calling module.
[guest - Wed May 28 06:48:55 2003]: Show quoted text
> Details: > Distributions: Net-SSH-Perl-1.23 > Perl Version : v5.6.1 built for i386-linux > OS: Linux xxx 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST 2003 i686 > unknown > > Problem: > If the connection fails because of any reason, the script dies, where > as it should report the error and allow the error to be handled by the > calling module.
Sorry, no. In case of an error in which it cannot proceed the module must die. If you want to catch the error use eval(). Maybe in future some use of the Exception module might be made but this is low priority.
Date: Tue, 10 Feb 2004 11:18:59 -0600 (CST)
From: Dave Rolsky <autarch [...] urth.org>
To: via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [cpan #2675] Failed connection aborts script
RT-Send-Cc:
On Tue, 10 Feb 2004, via RT wrote: Show quoted text
> > Details: > > Distributions: Net-SSH-Perl-1.23 > > Perl Version : v5.6.1 built for i386-linux > > OS: Linux xxx 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST 2003 i686 > > unknown > > > > Problem: > > If the connection fails because of any reason, the script dies, where > > as it should report the error and allow the error to be handled by the > > calling module.
> > Sorry, no. In case of an error in which it cannot proceed the module > must die. If you want to catch the error use eval(). > Maybe in future some use of the Exception module might be made but this > is low priority.
What we really need is _consistent_ error handling. Some methods may die, others do nothing and return no status. If _everything_ were guaranteed to die with an error message string on failure, at least users could wrap all calls in eval{}. I'm also considering doing something like DBI and offering a choice between throwing an exception and setting a message that can be retrieved via $ssh->error. Dana, let's talk more about this on the mailing list. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/
Date: Tue, 10 Feb 2004 12:24:19 -0500 (EST)
From: Dana Hudes <dhudes [...] tcp-ip.info>
To: "autarch [...] urth.org via RT" <bug-Net-SSH-Perl [...] rt.cpan.org>
Subject: Re: [cpan #2675] Failed connection aborts script
RT-Send-Cc:
going thru the code and checking status on open file handles / sockets and so on is certainly something I need to do. I will hopefully get to it very soon. Rather, get started on it -- I've no idea how long it'll take. On Tue, 10 Feb 2004, autarch@urth.org via RT wrote: Show quoted text
> > This message about Net-SSH-Perl was sent to you by autarch@urth.org <autarch@urth.org> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=2675 > > > On Tue, 10 Feb 2004, via RT wrote: >
> > > Details: > > > Distributions: Net-SSH-Perl-1.23 > > > Perl Version : v5.6.1 built for i386-linux > > > OS: Linux xxx 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST 2003 i686 > > > unknown > > > > > > Problem: > > > If the connection fails because of any reason, the script dies, where > > > as it should report the error and allow the error to be handled by the > > > calling module.
> > > > Sorry, no. In case of an error in which it cannot proceed the module > > must die. If you want to catch the error use eval(). > > Maybe in future some use of the Exception module might be made but this > > is low priority.
> > What we really need is _consistent_ error handling. Some methods may die, > others do nothing and return no status. If _everything_ were guaranteed > to die with an error message string on failure, at least users could wrap > all calls in eval{}. I'm also considering doing something like DBI and > offering a choice between throwing an exception and setting a message that > can be retrieved via $ssh->error. > > Dana, let's talk more about this on the mailing list. > > > -dave > > /*======================= > House Absolute Consulting > www.houseabsolute.com > =======================*/ >
From: mihai.secasiu [...] denixtech.net
I needed this feature and I had to modify the code. So that the script does not die on errors like "bad hostname" or "cannot connect"... if you want i will send you the diffs for version 1.25 [dhudes@tcp-ip.info - Tue Feb 10 12:24:26 2004]: Show quoted text
> going thru the code and checking status on open file handles /
sockets Show quoted text
> and so on is certainly something I need to do. > I will hopefully get to it very soon. > Rather, get started on it -- I've no idea how long it'll take. > > > > > On Tue, 10 Feb 2004, autarch@urth.org via RT wrote: >
> > > > This message about Net-SSH-Perl was sent to you by
autarch@urth.org Show quoted text
> <autarch@urth.org> via rt.cpan.org
> > > > Full context and any attached attachments can be found at: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=2675 > > > > > On Tue, 10 Feb 2004, via RT wrote: > >
> > > > Details: > > > > Distributions: Net-SSH-Perl-1.23 > > > > Perl Version : v5.6.1 built for i386-linux > > > > OS: Linux xxx 2.4.18-27.7.x #1 Fri Mar 14 06:44:53 EST 2003
i686 Show quoted text
> > > > unknown > > > > > > > > Problem: > > > > If the connection fails because of any reason, the script
dies, Show quoted text
> where
> > > > as it should report the error and allow the error to be
handled Show quoted text
> by the
> > > > calling module.
> > > > > > Sorry, no. In case of an error in which it cannot proceed the
> module
> > > must die. If you want to catch the error use eval(). > > > Maybe in future some use of the Exception module might be made
but Show quoted text
> this
> > > is low priority.
> > > > What we really need is _consistent_ error handling. Some methods
> may die,
> > others do nothing and return no status. If _everything_ were
> guaranteed
> > to die with an error message string on failure, at least users
could Show quoted text
> wrap
> > all calls in eval{}. I'm also considering doing something like
DBI Show quoted text
> and
> > offering a choice between throwing an exception and setting a
> message that
> > can be retrieved via $ssh->error. > > > > Dana, let's talk more about this on the mailing list. > > > > > > -dave > > > > /*======================= > > House Absolute Consulting > > www.houseabsolute.com > > =======================*/ > >
If there are specific fixes desired feel free to add them as requests but in general I think that existing die/croak failures are reasonable.