MooseX::Throwable - access to Moose's error messages - without a stack trace attached.
package MyClass; use Moose; use MooseX::Throwable; has required_attr => (required => 1, ...) ... eval { $o = MyClass->new; } print $@->message if $@;
This module changes Moose's error reporting to raise an exception rather than call confess. While confess is useful in development to provide a stack trace, it's less useful in production where stack traces are unwelcome yet the error message is still required.
The exception thrown provides access to both the message and stack trace separately.
Apply the necessary roles to caller.
Copyright (c) 2009 Chris Andrews <chris@nodnol.org>
To install MooseX::Throwable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Throwable
CPAN shell
perl -MCPAN -e shell install MooseX::Throwable
For more information on module installation, please visit the detailed CPAN module installation guide.