Exception::Argument - Thrown when called function or method with wrong argument


Fatal-Exception documentation Contained in the Fatal-Exception distribution.

Index


Code Index:

NAME

Top

Exception::Argument - Thrown when called function or method with wrong argument

SYNOPSIS

Top

  use Exception::Argument;

  sub method {
      my $self = shift;
      Exception::Argument->throw(
          message => 'Usage: $obj->method( STR )',
      ) if @_ < 1;
      my ($str) = @_;
      print $str;
  };

DESCRIPTION

Top

This class is an Exception::Base exception thrown when function or method was called with wrong argument.

BASE CLASSES

Top

ATTRIBUTES

Top

This class provides new attributes. See Exception::Base for other descriptions.

message : Str = "Bad argument" {rw}

Contains the message of the exception. This class overrides the default value from Exception::Base class.

SEE ALSO

Top

Exception::Base.

BUGS

Top

If you find the bug, please report it.

AUTHOR

Top

Piotr Roszatycki <dexter@debian.org>

LICENSE

Top

Copyright (C) 2008 by Piotr Roszatycki <dexter@debian.org>.

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

See http://www.perl.com/perl/misc/Artistic.html


Fatal-Exception documentation Contained in the Fatal-Exception distribution.

#!/usr/bin/perl -c

package Exception::Argument;

use 5.006;
use strict;
use warnings;

our $VERSION = 0.05;


use Exception::Base 0.21 (
    'Exception::Argument' => {
        isa     => 'Exception::Died',
        message => 'Bad argument',
    },
);


1;


__END__