diff options
author | Eric Wong <e@yhbt.net> | 2020-03-21 02:03:50 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-25 01:48:35 +0000 |
commit | d111c17ff06c9af7e0690e4b00a0eeb1c505c92a (patch) | |
tree | a79425d1a90e4d940a40742ef90523bbb380f00e /t/httpd-corner.psgi | |
parent | 90dc2b8ca53f93ca937e7cc71cd7c915e3df8020 (diff) | |
download | public-inbox-d111c17ff06c9af7e0690e4b00a0eeb1c505c92a.tar.gz |
As sqlite3(1) and other executables may become unavailable or uninstalled while a daemon runs, we need to gracefully handle errors in those cases.
Diffstat (limited to 't/httpd-corner.psgi')
-rw-r--r-- | t/httpd-corner.psgi | 7 |
1 files changed, 7 insertions, 0 deletions
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"; |