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

Owner: Nobody in particular
Requestors: marcoep [...]

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 [...]
From: Marco Emilio Poleggi <marcoep [...]>
Download (untitled) / with headers
text/plain 407b
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
Download (untitled) / with headers
text/plain 873b
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

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to