refactor: improve handling and reporting of project manager and lsp errors

This commit is contained in:
CJ van den Berg 2024-10-14 17:56:39 +02:00
parent da1ed11a22
commit dc25a0ea14
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 172 additions and 150 deletions

View file

@ -307,14 +307,14 @@ fn receive_safe(self: *Self, from: tp.pid_ref, m: tp.message) !void {
if (try self.send_widgets(from, m))
return;
if (try m.match(.{ "exit", "normal" }))
return;
if (try m.match(.{ "exit", "timeout_error", 125, "Operation aborted." }))
return;
if (try m.match(.{ "exit", "DEADSEND", tp.more }))
return;
if (try m.match(.{ "exit", tp.more })) {
if (try m.match(.{ tp.string, "normal" }) or
try m.match(.{ tp.string, "timeout_error", 125, "Operation aborted." }) or
try m.match(.{ tp.string, "DEADSEND", tp.more }) or
try m.match(.{ tp.string, "error.LspFailed", tp.more }) or
try m.match(.{ tp.string, "error.NoLsp", tp.more }))
return;
}
var msg: []const u8 = undefined;
if (try m.match(.{ "exit", tp.extract(&msg) }) or try m.match(.{ "exit", tp.extract(&msg), tp.more })) {