use Your::Point; my $point = Your::Point->new( x => 10, );
your.point error - No value specified for y
Thus Spake Andy:
If you then forget to provide an
y value then you'll get an
error thrown. Fail early. Fail often. The error is thrown as a
Badger::Exception object. This has an error type which defaults to a
dotted string based on the module that threw it (e.g.
your.point). You can use this to match different error types. It is
assumed to be hierarchical, so that you can catch all
for example, and that would include more specified exception types like
database.query, for example. The other part of
the exception is the error message for human consumption. The exception
object has an auto-stringification method so that you can simply print it
and see the type/message summary.