{"record":{"id":"30806ea97ece839f","repo":"quarkusio/quarkus","slug":"route-method-that-returns-void-must-accept-at-leas-30806e","errorCode":null,"errorMessage":"Route method that returns void must accept at least one parameter that can end the response [method: %s, bean: %s]","messagePattern":"Route method that returns void must accept at least one parameter that can end the response \\[method: (.+?), bean: (.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java","lineNumber":593,"sourceCode":"                            \"HandlerType.%s is not legal for parameter %s of route method %s declared on %s\",\n                            injector.getTargetHandlerType(), idx, method, bean));\n                }\n\n                // A param injector may validate the parameter annotations\n                injector.validate(bean, method, routeAnnotation, paramType, paramAnnotations);\n\n                if (injector.canEndResponse) {\n                    canEndResponse = true;\n                }\n\n                if (Route.HandlerType.FAILURE == handlerType && isThrowable(paramType, index)) {\n                    failureParams++;\n                }\n                idx++;\n            }\n\n            if (method.returnType().kind() == Kind.VOID && !canEndResponse) {\n                throw new IllegalStateException(String.format(\n                        \"Route method that returns void must accept at least one parameter that can end the response [method: %s, bean: %s]\",\n                        method, bean));\n            }\n\n            if (failureParams > 1) {\n                throw new IllegalStateException(String.format(\n                        \"A failure handler may only define one failure parameter - route method %s declared on %s\",\n                        method, bean));\n            }\n        }\n    }\n\n    private String generateHandler(HandlerDescriptor desc, BeanInfo bean, MethodInfo method, Gizmo gizmo,\n            TransformedAnnotationsBuildItem transformedAnnotations, AnnotationInstance routeAnnotation,\n            BuildProducer<ReflectiveHierarchyBuildItem> reflectiveHierarchy, String defaultProduces,\n            boolean validatorAvailable, IndexView index) {\n\n        if (desc.requireValidation() && !validatorAvailable) {","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java#L575-L611","documentation":"Raised by ReactiveRoutesProcessor.validateRouteMethod after the parameter loop when a void route method has no parameter whose injector can end the response. The processor tracks canEndResponse across all matched injectors (RoutingContext and body writers set it); a void method without any such parameter would return without ever replying to the client, leaving requests hanging, so validation rejects the signature at build time.","triggerScenarios":"Thrown at extensions/reactive-routes/deployment/src/main/java/io/quarkus/vertx/web/deployment/ReactiveRoutesProcessor.java:593 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a parameter that can end the response, such as RoutingContext, and call response.end()","Return a value from the method instead of declaring it void"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}