This is the Point example from
Moose::Cookbook::Basics::Point_AttributesAndSubclassing with type checking
If we try to assign a string value to an attribute that is an Int,
Moose will die with an explicit error message. The error will include
the attribute name, as well as the type constraint name and the value
which failed the constraint check.
We use Try::Tiny to catch this error message.
Later, we get the Moose::Meta::TypeConstraint object from a
Moose::Meta::Attribute and use the Moose::Meta::TypeConstraint
to check a value directly.