Error Messages

package Your::Point;
use base 'Badger::Base';

our $THROWS = 'point';

sub init {
    my ($self, $config) = @_;

    $self->{ x } = 
      defined $config->{ x }
            ? $config->{ x }
            : $self->error("No value specified for x");

    # ...same for y...

    return $self;
}
Thus Spake Andy:

If you want to throw a different exception type, simply set the $THROWS package variable.