]> Sergey Matveev's repositories - public-inbox.git/commit
qspawn: improve error reporting and handling
authorEric Wong <e@80x24.org>
Mon, 22 Aug 2022 02:33:44 +0000 (02:33 +0000)
committerEric Wong <e@80x24.org>
Tue, 23 Aug 2022 04:19:01 +0000 (04:19 +0000)
commit20e17ab617026ec61a6878b5b954b86a2ca69a08
tree837e9bdcb833c1dfafaf0811a23f3a8ce2e9423e
parent3ac9f1f873bf7d7b9075cf492733a3d79b32e22a
qspawn: improve error reporting and handling

First off, avoid potential circular references (via {qx_arg}) by
dropping the {-qsp} field from $ctx and SolverGit objects.
Instead, we only share a reference to an optional error buffer
string {qsp_err}.

We'll also attempt to call qspawn.wcb if qx_cb fails, and warn
in more places w/o checking for $env since we now rely on warn()
instead of $env->{'psgi.errors'}.

This makes error handling simpler and safer in future callers.
lib/PublicInbox/Qspawn.pm
lib/PublicInbox/SolverGit.pm
lib/PublicInbox/ViewVCS.pm
t/qspawn.t