Chris Andrews

NAME

MooseX::Throwable - access to Moose's error messages - without a stack trace attached.

SYNOPSIS

  package MyClass;
  use Moose;
  use MooseX::Throwable;

  has required_attr => (required => 1, ...)

  ...

  eval {
    $o = MyClass->new;
  }
  print $@->message if $@;

DESCRIPTION

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.

METHODS

init_meta

Apply the necessary roles to caller.

AUTHOR

Copyright (c) 2009 Chris Andrews <chris@nodnol.org>