Commits

Toby Inkster committed 151687d

ws

  • Participants
  • Parent commits 9251169

Comments (0)

Files changed (1)

lib/Throwable/Factory.pm

 	package Throwable::Factory;
 	our $AUTHORITY = 'cpan:TOBYINK';
 	our $VERSION   = '0.001';
-
+	
 	use MooX::Struct -retain,
 		Base => [
 			-class   => \'Throwable::Factory::Struct',
 		local $Data::Dumper::Deparse = 0;
 		local $Data::Dumper::Quotekeys = 0;
 		local $Data::Dumper::Sortkeys = 1;
-
+		
 		my $self = shift;
 		my $str  = $self->message . "\n\n";
 		
 
 =head1 SYNOPSIS
 
-	use Throwable::Factory
-		GeneralException => undef,
-		FileException    => [qw( $filename )],
-		NetworkException => [qw( $remote_addr $remote_port )],
-	;
-	
-	# Just a message...
-	#
-	GeneralException->throw("Something bad happened");
-	
-	# Or use named parameters...
-	#
-	GeneralException->throw(message => "Something awful happened");
+   use Throwable::Factory
+      GeneralException => undef,
+      FileException    => [qw( $filename )],
+      NetworkException => [qw( $remote_addr $remote_port )],
+   ;
+   
+   # Just a message...
+   #
+   GeneralException->throw("Something bad happened");
+   
+   # Or use named parameters...
+   #
+   GeneralException->throw(message => "Something awful happened");
 
-	# The message can be a positional parameter, even while the
-	# rest are named.
-	#
-	FileException->throw(
-		"Can't open file",
-		filename => '/tmp/does-not-exist.txt',
-	);
+   # The message can be a positional parameter, even while the
+   # rest are named.
+   #
+   FileException->throw(
+      "Can't open file",
+      filename => '/tmp/does-not-exist.txt',
+   );
 
-	# Or, they all can be a positional using an arrayref...
-	#
-	NetworkException->throw(["Timed out", "11.22.33.44", 555]);
+   # Or, they all can be a positional using an arrayref...
+   #
+   NetworkException->throw(["Timed out", "11.22.33.44", 555]);
 
 =head1 DESCRIPTION
 
 to describe the exception classes. The following two definitions are
 equivalent:
 
-	# MooX::Struct-style
-	use Throwable::Factory FooBar => [
-		-extends => ['Foo'],
-		qw( foo bar ),
-	];
-	
-	# Exception::Class-style
-	use Throwable::Factory FooBar => {
-		isa    => 'Foo',
-		fields => [qw( foo bar )],
-	};
+   # MooX::Struct-style
+   use Throwable::Factory FooBar => [
+      -extends => ['Foo'],
+      qw( foo bar ),
+   ];
+   
+   # Exception::Class-style
+   use Throwable::Factory FooBar => {
+      isa    => 'Foo',
+      fields => [qw( foo bar )],
+   };
 
 =head1 BUGS