{"record":{"id":"b67a57918fa8e3be","repo":"quarkusio/quarkus","slug":"unsupported-parameter-type-used-in-clientexceptio","errorCode":null,"errorMessage":"Unsupported parameter type used in @ClientExceptionMapper. See the Javadoc of the annotation for the supported types. Offending instance is '${className}#${methodName}'","messagePattern":"Unsupported parameter type used in @ClientExceptionMapper\\. See the Javadoc of the annotation for the supported types\\. Offending instance is '(.+?)#(.+?)'","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/ClientExceptionMapperHandler.java","lineNumber":142,"sourceCode":"                    for (Type paramType : target.parameterTypes()) {\n                        Expr targetMethodParamHandle;\n                        DotName paramTypeName = paramType.name();\n                        if (paramTypeName.equals(ResteasyReactiveDotNames.RESPONSE)) {\n                            targetMethodParamHandle = response;\n                        } else if (paramTypeName.equals(DotNames.METHOD)) {\n                            targetMethodParamHandle = bc.invokeVirtual(GET_INVOKED_METHOD, requestContext);\n                        } else if (paramTypeName.equals(DotNames.URI)) {\n                            targetMethodParamHandle = bc.invokeVirtual(GET_URI, requestContext);\n                        } else if (isMapStringToObject(paramType)) {\n                            targetMethodParamHandle = bc.invokeVirtual(GET_PROPERTIES, requestContext);\n                        } else if (isMultivaluedMapStringToString(paramType)) {\n                            targetMethodParamHandle = bc.invokeVirtual(GET_REQUEST_HEADERS_AS_MAP, requestContext);\n                        } else {\n                            String message = \"Unsupported parameter type used in \" + DotNames.CLIENT_EXCEPTION_MAPPER\n                                    + \". See the Javadoc of the annotation for the supported types.\"\n                                    + \" Offending instance is '\" + target.declaringClass().name().toString() + \"#\"\n                                    + target.name() + \"'\";\n                            throw new IllegalStateException(message);\n                        }\n                        targetMethodParams.put(paramTypeName.toString(), targetMethodParamHandle);\n                    }\n\n                    Expr resultHandle = bc.invokeStatic(methodDescOf(target),\n                            targetMethodParams.values().toArray(new Expr[0]));\n                    bc.return_(resultHandle);\n                });\n            });\n\n            if (finalPriority != Priorities.USER) {\n                cc.method(\"getPriority\", mc -> {\n                    mc.returning(int.class);\n                    mc.body(bc -> {\n                        bc.return_(Const.of(finalPriority));\n                    });\n                });\n            }","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/ClientExceptionMapperHandler.java#L124-L160","documentation":"A @ClientExceptionMapper method may only declare parameters Quarkus knows how to provide at build time — the Response, or the invoked java.lang.reflect.Method (e.g. via RequestContext accessors). During bytecode generation, any other parameter type hits the else branch and aborts the build with this IllegalStateException.","triggerScenarios":"Declaring a @ClientExceptionMapper static method with a parameter of an unsupported type (e.g. String, URI, custom context objects, or a Map obtained through an unsupported accessor).","commonSituations":"Copy-pasting server-side @ServerExceptionMapper signatures (which accept more types); adding extra 'helpful' parameters; upgrading Quarkus where previously-lenient parameter handling was tightened.","solutions":["Reduce the method signature to only supported parameters: jakarta.ws.rs.core.Response and/or java.lang.reflect.Method","If you need headers/status, extract them inside the method body from the Response parameter instead of receiving them as parameters","Consult the @ClientExceptionMapper Javadoc for the exhaustive list of supported parameter types"],"exampleFix":"// before\n@ClientExceptionMapper\nstatic RuntimeException map(Response r, String endpoint) { ... } // 'endpoint' unsupported\n// after\n@ClientExceptionMapper\nstatic RuntimeException map(Response r) {\n    String endpoint = r.getLocation() != null ? r.getLocation().toString() : null;\n    return new RuntimeException(\"failed: \" + endpoint);\n}","handlingStrategy":"validation","validationCode":"static boolean supportedParams(Method m) {\n    for (Class<?> p : m.getParameterTypes()) {\n        if (p != jakarta.ws.rs.core.Response.class && p != java.lang.reflect.Method.class) return false;\n    }\n    return true;\n}","typeGuard":null,"tryCatchPattern":"try {\n    handler.generateResponseExceptionMapper(classResult, instance);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Unsupported parameter type\")) { /* reduce params */ }\n    throw e;\n}","preventionTips":["Only use Response or java.lang.reflect.Method as mapper parameters","Extract derived values (status, headers) inside the method body","Consult the @ClientExceptionMapper Javadoc's supported-types list","Avoid copy-pasting @ServerExceptionMapper signatures into clients"],"tags":["rest-client","exception-mapper","build-time","bytecode-generation"],"backgroundTag":"rest-client-annotation-misuse","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}