Add error return trace (#882)

This commit is contained in:
Auguste Rame 2023-01-03 10:37:59 -05:00 committed by GitHub
parent a574ac68ba
commit 20baa592eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3049,6 +3049,9 @@ fn processMessage(server: *Server, message: Message) Error!void {
const params: ParamsType = tres.parse(ParamsType, message.params().?, server.arena.allocator()) catch return error.InternalError; const params: ParamsType = tres.parse(ParamsType, message.params().?, server.arena.allocator()) catch return error.InternalError;
const response = handler(server, params) catch |err| { const response = handler(server, params) catch |err| {
log.err("got {} error while handling {s}", .{ err, method }); log.err("got {} error while handling {s}", .{ err, method });
if (@errorReturnTrace()) |trace| {
std.debug.dumpStackTrace(trace.*);
}
return error.InternalError; return error.InternalError;
}; };