Skip Menu |

This queue is for tickets about the IO-Socket-SSL CPAN distribution.

Report information
The Basics
Id: 37087
Status: resolved
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Nobody in particular
Requestors: marcoep [...] gmail.com
Cc:
AdminCc:

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



Subject: sub error() prints messages only if debugging is enabled
Date: Wed, 25 Jun 2008 14:31:18 +0200
To: bug-IO-Socket-SSL [...] rt.cpan.org
From: Marco Emilio Poleggi <marcoep [...] gmail.com>
Hi there, Subroutine error() has carp $error."\n".$self->get_ssleay_error() if $DEBUG; which inhibits printing of useful messages when debugging is not enabled. Thus catching errors from higher level modules, such as SOAP::Lite, is difficult. I suggest to remove 'if $DEBUG', so that anyone is free to catch the warnings thrown by carp with appropriate __WARN__ handlers. Cheers, Marco E. Poleggi
Hi, I see two major ways for error handling in perl: - die() or croak() so that an exception gets raised (which could be handled with eval) - or signal the problem with a return code and expect the user to query details of the problem (this is the way with most low level calls, where you get undef and then query $!) I would not expect a module to clutter my stderr by default if it finds a problem (this is what carp does). Stderr is for humans only, and I would expect the calling program to notice the error, work around it if it can and tell the human about the problem only, if it cannot work around it. I think it's ok to clutter stderr in debug mode - that's what debugging is for. So I will not change the behavior, but you should be able to force debug mode in a program using IO::Socket::SSL by doing: perl -MIO::Socket::SSL=debug1 program.pl