quarkusio/quarkus · error · RuntimeException

RuntimeException(e)

Error message

RuntimeException(e)

What it means

BaseObjectReader.setValue() populates an object's field/setter from parsed query data and wraps any exception (from setters, converters, or value readers) into a RuntimeException. The original cause is preserved; look at getCause() for the real failure.

Source

Thrown at extensions/funqy/funqy-server-common/runtime/src/main/java/io/quarkus/funqy/runtime/query/BaseObjectReader.java:78

                List<Object> propEntry = paramToObject.get(propName);
                Object obj;
                Map<String, List<Object>> paramEntries;
                if (propEntry == null) {
                    obj = setter.getSetter().create();
                    paramEntries = new HashMap<>();
                    propEntry = Arrays.asList(obj, paramEntries);
                    paramToObject.put(propName, propEntry);
                    setter.setValue(target, propName, obj);
                } else {
                    obj = propEntry.get(0);
                    paramEntries = (Map<String, List<Object>>) propEntry.get(1);
                }
                setter.getSetter().setValue(obj, suffix, value, paramEntries);
            } else {
                // throw Exception?
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the cause chain — the wrapped exception identifies the failing setter or converter
  2. Fix the query string values to match the POJO field types
  3. Adjust the POJO setter to accept the incoming type or add a converter
  4. Null-check or guard setter logic that can throw on edge inputs

Example fix

// before
public void setCount(String count) { this.count = Integer.parseInt(count); } // throws on "abc"
// after
public void setCount(String count) {
    try { this.count = Integer.parseInt(count); } catch (NumberFormatException e) { this.count = 0; }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate query values against POJO types before invocation
Object val = request.getParameter("count");
if (val != null && !val.toString().matches("\\d+"))
    throw new IllegalArgumentException("count must be numeric");

Try / catch

try {
    reader.readValue(obj, queryParams);
} catch (RuntimeException e) {
    Throwable cause = e.getCause();
    log.errorf(cause, "Query binding failed while setting %s", cause.getMessage());
    throw new BadRequestException("Invalid query parameters", e);
}

Prevention

When it happens

Trigger: Funqy query-parameter binding where a nested property value can't be set: incompatible value type for the setter, malformed query string, or a setter that throws.

Common situations: Passing a query param like ?nested.field=abc where field expects a number; custom setter throwing during conversion; type mismatch between query string and POJO field type.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/bec6a81252a984a9. Report an issue: GitHub.