# HG changeset patch # User Kim Alvefur # Date 1745307620 -7200 # Node ID c71d8bc77c9565371b8d029d122d7adfdcea7b06 # Parent e2648638f3e0fdee2029715d4238e6d5fdf362d9 mod_rest: Skip unpacking error object when missing (thanks Martin) Not every "http-error" event includes a .error field, so it may attempt to unpack `nil`. diff -r e2648638f3e0 -r c71d8bc77c95 mod_rest/mod_rest.lua --- a/mod_rest/mod_rest.lua Mon Apr 21 17:57:48 2025 +0200 +++ b/mod_rest/mod_rest.lua Tue Apr 22 09:40:20 2025 +0200 @@ -664,6 +664,7 @@ -- strip some stuff, notably the optional traceback table that casues stack overflow in util.json local function simplify_error(e) + if not e then return end return { type = e.type; condition = e.condition;