The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Contentment::Exception - Used to throw exceptions in Contentment

SYNOPSIS

  use Contentment::Exception;

  # Throw a general exception...
  Contentment::Exception->throw(
      status  => 404,
      title   => 'Not Found',
      message => 'Couldn't find it.'
      details => 'Well, it's kind of a long story. First, I looked...',
  );

DESCRIPTION

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

status

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.

title

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: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). A table of these is stored in the %Contentment::Exception::status_code_titles variable.

details

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

location

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.

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2005 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>. 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.