From: David Nicol
>
>To: publiustemp-moduleautho...@yahoo.com
>
>I've never understood what's wrong with using string exceptions for this kind
>of thing. Maintaining a discipline about properly dieing is required both
>ways, and
>
> defined ($nextline = ) or die "IO CANTREAD: eof on INPUT?"'
On Fri, Apr 9, 2010 at 1:54 AM, Ovid
wrote:
> (Javaesque psuedo-code):
>
> try {
>customer.read();
> }
> catch ( Exception::IO::NotFound e ) { ... }
> catch ( Exception::IO::CantOpen e ) { ... }
> catch ( Exception::IO::CantRead e ) { ... }
> catch ( Exception::IO e ) { ... }
>
* Ovid [2010-04-09 08:55]:
> Buut ... that's why you want those exceptions in classes
> instead of as hash keys.
Of course.
Just saying that if you *do* consider too many exception classes
a problem in need of a solution, then using a field as a message
selection key would at least preclude
--- On Fri, 9/4/10, Aristotle Pagaltzis wrote:
> From: Aristotle Pagaltzis
> Why?
>
> I guess that could be addressed by allowing a hash of
> formats and
> then offering the throwing site to pick one of them by
> setting
> a special field.
>
> The key here is that you want to avoid a situatio
* Lutz Gehlen [2010-04-09 01:55]:
> I think that an own class for each message might be a bit of an
> overkill.
Why?
I guess that could be addressed by allowing a hash of formats and
then offering the throwing site to pick one of them by setting
a special field.
The key here is that you want to
Hi Ovid,
On Wed, Apr 07, 2010 at 12:04:08AM -0700, Ovid wrote:
> --- On Wed, 7/4/10, Lutz Gehlen wrote:
> > What I need a central place for is the definition of the
> > actual
> > error messages. With my module Exception::EasyThrow, I can
> > write at
> > the beginning of my module:
> >
> > us
* Ovid [2010-04-07 09:05]:
> Presumably the format should try to determine the number of
> conversions in the format and perhaps the alias could generate
> a sub with a corresponding prototype like 'sub
> throw_io_read($$)'. That might give you a touch of compile-time
> safety. Haven't really thou
--- On Wed, 7/4/10, Lutz Gehlen wrote:
> From: Lutz Gehlen
> I understand that I can build a hierarchy of exception
> classes using
> Exception::Class. But when I throw an exception I still
> have to
> assemble the error message there, e.g.:
>
> if(!defined($foo)) {
> My::Exception::Clas
If I understand you right, you want the possibility to define exception
hierarchies _and_ the possibility to have a constant way of throwing exception
that is shorter to write.
you can declare classes and derivatives very easily without using
Exception::Class simply with the 'package' keyword
Hi Aristotle,
sorry for the delayed reply, I had some computer problems and then
this topic slipped a bit out of my mind.
On Friday 12 March 2010 23:33:40 Aristotle Pagaltzis wrote:
> * Lutz Gehlen [2010-02-21 01:40]:
> > 1) The first question deals with how to throw exceptions
> > properly. In
On Fri, 12 Mar 2010, Aristotle Pagaltzis wrote:
I’m sure you can already imagine where this is going: basically,
you should check your own intermediate computed values, to ensure
you don’t propagate error conditions sideways between parts of
your own code. But if you operate on user input direct
Hi Lutz,
* Lutz Gehlen [2010-02-21 01:40]:
> 1) The first question deals with how to throw exceptions
> properly. In projects which ask for a more sophisticated way
> than just carping or croaking I use Exception::Class. However,
> in both cases the error message has to be assembled when the
> er
--As of February 21, 2010 1:43:58 PM +1300, Lutz Gehlen is alleged to have
said:
Therefore I would like to define my error messages in some sprintf
format way at a central place and use these templates when the time
has come. I have written a module Exception::Class::EasyThrow that
does this. H
Hello everybody,
I am writing this email to ask two general questions about throwing
exceptions. Parts of them are not restricted to Perl and just
reflect my general lack of knowledge about how to deal with
exceptions in a professional way. So if you think "RTFM" when you
read on, I am happy to
14 matches
Mail list logo