From d111c17ff06c9af7e0690e4b00a0eeb1c505c92a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Mar 2020 02:03:50 +0000 Subject: qspawn: handle ENOENT (and other errors on exec) As sqlite3(1) and other executables may become unavailable or uninstalled while a daemon runs, we need to gracefully handle errors in those cases. --- t/httpd-corner.psgi | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/httpd-corner.psgi') diff --git a/t/httpd-corner.psgi b/t/httpd-corner.psgi index f2427234..44629620 100644 --- a/t/httpd-corner.psgi +++ b/t/httpd-corner.psgi @@ -94,6 +94,13 @@ my $app = sub { return $qsp->psgi_return($env, undef, sub { [ 200, [ qw(Content-Type application/octet-stream)]] }); + } elsif ($path eq '/psgi-return-enoent') { + require PublicInbox::Qspawn; + my $cmd = [ 'this-better-not-exist-in-PATH'.rand ]; + my $qsp = PublicInbox::Qspawn->new($cmd); + return $qsp->psgi_return($env, undef, sub { + [ 200, [ qw(Content-Type application/octet-stream)]] + }); } elsif ($path eq '/pid') { $code = 200; push @$body, "$$\n"; -- cgit v1.2.3-24-ge0c7