[Bps-public-commit] r16058 - in Prophet/branches/dispatcher: lib/Prophet/CLI

sartak at bestpractical.com sartak at bestpractical.com
Thu Sep 25 14:48:53 EDT 2008


Author: sartak
Date: Thu Sep 25 14:48:53 2008
New Revision: 16058

Modified:
   Prophet/branches/dispatcher/   (props changed)
   Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm

Log:
 r72455 at onn:  sartak | 2008-09-25 14:48:34 -0400
 NotFound


Modified: Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	(original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	Thu Sep 25 14:48:53 2008
@@ -32,6 +32,21 @@
     $server->run;
 };
 
+on qr/()/ => sub {
+    my $self = shift;
+    $self->fatal_error("The command you ran could not be found. Perhaps running '$0 help' would help?");
+};
+
+sub fatal_error {
+    my $self   = shift;
+    my $reason = shift;
+
+    # always skip this fatal_error function when generating a stack trace
+    local $Carp::CarpLevel = $Carp::CarpLevel + 1;
+
+    die $reason . "\n";
+}
+
 sub setup_server {
     my $self = shift;
     require Prophet::Server;



More information about the Bps-public-commit mailing list