}
}
+\f
+#
+# - Local exception definitions and utilities
+#
+
+{
+ package Local::Exception;
+
+ sub type { (shift)->{type} }
+ sub summary { (shift)->{summary} }
+
+ sub type_p {
+ my $self = shift;
+ my $query = shift;
+
+ return $self->{type} eq $query
+ }
+}
+
+=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.
+
+=cut
+
+sub throw {
+ my $type = shift;
+
+ die bless {type => $type, @_}, 'Local::Exception::'.$type;
+}
+
\f
#
# - GPG helpers