Skip to content

Commit

Permalink
catch nack startup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
leedo committed Dec 27, 2012
1 parent e1c17c7 commit 29e4c5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Plack/App/Prack/Worker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use warnings;

use Time::HiRes;
use File::Temp ':POSIX';
use JSON;
use IO::Socket::UNIX;
use Plack::App::Prack::Request;

Expand Down Expand Up @@ -42,6 +43,12 @@ sub spawn {
# read the pid
my $p = $sock->getline;

# could be a stack trace
if ($p !~ /^\d+$/) {
my $stack = decode_json $p;
die "$stack->{name}: $stack->{message}";
}

$self->{sock} = $sock;
$self->{file} = $tmp;
}
Expand Down

0 comments on commit 29e4c5a

Please sign in to comment.