Class::Maker::Exception - exceptions tuned for Class::Maker


Class-Maker documentation  | view source Contained in the Class-Maker distribution.

Index


NAME

Top

Class::Maker::Exception - exceptions tuned for Class::Maker

SYNOPSIS

Top

	use Class::Maker qw(class);

	use Class::Maker::Exception qw(:try);

	{
	package Exception::Child;

		Class::Maker::class
		{
			isa => [qw( Class::Maker::Exception )],

			public =>
			{
				string => [qw( email )],
			},
		};

	package Exception::ChildChild;

		Class::Maker::class
		{
			isa => [qw( Exception::Child )],

			public =>
			{
				string => [qw( name )],
			},
		};
	}

	sub do_some_stuff
	{
		Exception::ChildChild->throw( email => 'bla@bla.de', name => 'johnny' );

	return;
	}

		try
		{
			do_some_stuff();

		}
		catch Exception::ChildChild with
		{
			foreach my $e (@_)
			{
				print Dumper $e;
			}
		};

DESCRIPTION

Top

This is mainly a wrapper to "Error" from CPAN. Because it has a very odd inheritance mechanism, this wrapper is needed as a workarround.

BUGS

Top

Not critical: The "text" attribute is not working. Reading/Writing to it somehow goes into nirvana. I suppose "Error" has same clue about it. Would suggest to inherit from Class::Maker::Exception and add and new "info_text" attribute, which will work.

BASE CLASSES

Top

Class::Maker::Exception

Has following structure (and inheritable attributes).

	class
	{					
		isa => [qw( Error )],

		public =>
		{
			string => [qw( text package file )],

			integer => [qw( line )],
		},
	};

AUTHOR

Top

Murat Uenalan

SEE ALSO

Top

Error


Class-Maker documentation  | view source Contained in the Class-Maker distribution.