From fc278ced4e033fa7a1942f507c88979dcf6f726c Mon Sep 17 00:00:00 2001 From: iroqueta Date: Tue, 21 Apr 2026 18:26:33 -0300 Subject: [PATCH] Catch Throwable in getJsonObject to avoid breaking SDT serialization Since Jackson now serializes full objects when they are not HashMap (commit 3e2b9e7e), reflective invocation of getters like HttpContextNull.getPostData() / getResponse() can throw InternalError. InternalError extends Error (not Exception), so catch(Exception) did not catch it and the error propagated up through GXSimpleCollection .toJSonString(), breaking any call that serialized an SDT containing an HttpContext (e.g. GAMLoginAdditionalParameters). Widening the catch to Throwable lets getJsonObject log the problem and return an empty JSON object, preserving the previous behavior for objects that fail reflective serialization. --- java/src/main/java/com/genexus/GxUserType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/main/java/com/genexus/GxUserType.java b/java/src/main/java/com/genexus/GxUserType.java index 1b8c5e97b..ac083ff6c 100644 --- a/java/src/main/java/com/genexus/GxUserType.java +++ b/java/src/main/java/com/genexus/GxUserType.java @@ -45,7 +45,7 @@ protected Object getJsonObjectFromHashMap( Object userType) { jsonObj = new JSONObjectWrapper(jsonString); } } - catch(Exception e) { + catch(Throwable e) { log.error("Could not create Json Object", e); } return jsonObj;