return $self->{type} eq $query
}
+
+
+=item throw $type => ($key => $value)...
+
+=item throw Local::Exception::$type ($key => $value)...
+
+Throw a TYPE exception, with further options specified as key/value pairs.
+
+All types include a brief summary given with the C<summary> option or
+implied by the type. This summary is sent to the log.
+
+This can be called as a class method on any exception type or imported and
+called as a function. The C<Local::Exception::> prefix may be omitted when
+called as a function.
+
+=cut
+
+ sub throw {
+ my $type; ($type = shift) =~ s/^Local::Exception:://;
+ my $ob = bless {type => $type, @_}, 'Local::Exception::'.$type;
+
+ # ftp_syslog is a function defined at top-level in main
+ ::ftp_syslog err => $ob->summary if $ob->summary;
+
+ die $ob;
+ }
+
}
+BEGIN { *throw = \&Local::Exception::throw }
+
{
package Local::Exception::package_configuration;
{our @ISA = qw(Local::Exception)}
END
}
-=item throw $type => ($key => $value)...
-
-Throw a TYPE exception, with further options specified as key/value pairs.
-
-All types include a brief summary given with the C<summary> option or
-implied by the type. This summary is sent to the log.
-
-=cut
-
-sub throw {
- my $type = shift;
- my $ob = bless {type => $type, @_}, 'Local::Exception::'.$type;
-
- ftp_syslog err => $ob->summary if $ob->summary;
-
- die $ob;
-}
-
\f
=back