Thanks for your feedback. I like the name Exception::Clear and your point about "::Lite" is well taken.

I am concerned by the perception that he overall impression I get from your module description is that its output is just more informative than all the other Exception modules

This points to a failure on my part to clearly describe the exception class and what it adds. Better management of the actual creation of exceptions was also a goal. In fact it was the original motivation. I only added the improved debugging output later on as I put the exception class into production. In all of the other modules I could find, you can define properties and you can define a message, but if there is any connection between the two, you have to set it up outside the exception, or else create a subclass of the module.

In Exception::Class and pretty much all of the other OOPish CPAN exception modules you have to do something like this:

#... at the start of your code ... # notice how exception definition and message format # string constant are in two different places and need # to be manually coordinated by the programmer. use Exception::Class { 'Exception::Copy::Mine' { fields => [qw(from to)]; } # ... lots of other exceptions here ... } my $MSG_COPY='Could not copy A.txt to B.txt"; ... later on when you throw the exception ... # notice the repetition in the use of exception # properties; the repetition is error prone and adds # unnecessary extra typing my $sMsg = sprintf($MSG_COPY, 'A.txt', 'B.txt'); Exception::Copy::Mine->throw(error => $sMsg , from => 'A.txt' , to => 'B.txt');

As far as I can see, none of the other modules allow you do do something succinct and easy to maintain like this:

# the declaration puts the message format string and the # class declaration together for the programmer, thus # resulting in less maintenence work declareExceptionClass("Exception::Mine::Copy" , "Could not copy %s to %s", [ qw(from, to) ]); .... some where else in your code ... # there is no need to explicitly call sprintf or # repetitively type variable names, nor even remember # the order of parameters in the format string or check # for undefined values. Both of these will produce # the same error message: # "Could not copy A.txt to B.txt" die "Exception::Mine:Copy"->new(from =>'A.txt', to=>'B.txt'); die "Exception::Mine:Copy"->new(to =>'B.txt', from=>'A.txt'); # and this will politely fill in 'undef' for the # property you leave out: # "Could not copy A.txt to <undef>" die "Exception::Mine::Copy"->new(from=>'A.txt');

In reply to Re^2: RFC: A better name for an exception handling module? by ELISHEVA
in thread RFC: A better name for an exception handling module? by ELISHEVA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.