Andrew Sterling Hanenkamp
and 1 contributors


Contentment::Exception - Used to throw exceptions in Contentment


  use Contentment::Exception;

  # Throw a general exception...
      status  => 404,
      title   => 'Not Found',
      message => 'Couldn't find it.'
      details => 'Well, it's kind of a long story. First, I looked...',


Exceptions for Contentment based upon Exception::Class. In addition to the features of that class, it provides these additional fields:


This is the HTTP status that the exception should result in if it propogates all the way to the top-level request. The default is 500.


This is the title of the error. This defaults to the status code names found in RFC-2616. (These can be found at the W3C web site: A table of these is stored in the %Contentment::Exception::status_code_titles variable.


This should be any additional debugging information that should be associated with the message, but not shown to general users.


If the exception is set to use a 3xx status code (in particular, 301 Moved Permanently and 302 Found), this is the URI that the client should be resent to. If the exception reaches the top level.


Andrew Sterling Hanenkamp, <>


Copyright 2005 Andrew Sterling Hanenkamp <>. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.