Skip to content

Commit 62c0298

Browse files
authored
Catch Throwable in getJsonObject to avoid breaking SDT serialization (#1104)
Since Jackson now serializes full objects when they are not HashMap (commit 3e2b9e7), 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.
1 parent 66bdc4d commit 62c0298

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java/src/main/java/com/genexus/GxUserType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected Object getJsonObjectFromHashMap( Object userType) {
4545
jsonObj = new JSONObjectWrapper(jsonString);
4646
}
4747
}
48-
catch(Exception e) {
48+
catch(Throwable e) {
4949
log.error("Could not create Json Object", e);
5050
}
5151
return jsonObj;

0 commit comments

Comments
 (0)