From 34aabc27a31f4364502748a14c27236b2f33cfb0 Mon Sep 17 00:00:00 2001 From: Ricardo Signes Date: Sat, 9 Jan 2010 21:45:05 -0500 Subject: [PATCH] document the one-arg-message form a bit more --- lib/Throwable/Error.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/Throwable/Error.pm b/lib/Throwable/Error.pm index 9a7f0ff..f54f5ec 100644 --- a/lib/Throwable/Error.pm +++ b/lib/Throwable/Error.pm @@ -9,11 +9,22 @@ with 'Throwable'; use Moose; extends 'Throwable::Error'; - has execution_phase => (is => 'ro', isa => 'MyApp::Phase'); + has execution_phase => ( + is => 'ro', + isa => 'MyApp::Phase', + default => 'startup', + ); ...and in your app... - MyApp::Error->throw({ phase => $self->phase }); + MyApp::Error->throw("all communications offline"); + + # or... + + MyApp::Error->throw({ + message => "all communications offline", + phase => 'shutdown', + }); =head1 DESCRIPTION