{"record":{"id":"f93949e3c9f3c944","repo":"quarkusio/quarkus","slug":"either-function-or-runtimevalue-must-be-provided","errorCode":null,"errorMessage":"Either function or runtimeValue must be provided","messagePattern":"Either function or runtimeValue must be provided","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java","lineNumber":293,"sourceCode":"            this.runtimeValue = runtimeValue;\n            return this;\n        }\n\n        public void build() {\n            if (methodName == null || methodName.isBlank())\n                throw new IllegalStateException(\"methodName must be provided\");\n            if (parameters.isEmpty())\n                parameters = null;\n            if (function != null) {\n                addSubscription(new DeploymentJsonRpcMethod(methodName, description, parameters, autoUsage(usage, description),\n                        mcpEnabledByDefault,\n                        function));\n            } else if (runtimeValue != null) {\n                addSubscription(\n                        new RecordedJsonRpcMethod(methodName, description, autoUsage(usage, description), mcpEnabledByDefault,\n                                runtimeValue));\n            } else {\n                throw new IllegalStateException(\"Either function or runtimeValue must be provided\");\n            }\n        }\n    }\n\n    private EnumSet<Usage> autoUsage(EnumSet<Usage> usage, String description) {\n        if (usage == null && description == null) {\n            usage = Usage.onlyDevUI();\n        } else if (usage == null) {\n            usage = Usage.devUIandDevMCP();\n        }\n        return usage;\n    }\n}\n","sourceCodeStart":275,"sourceCodeEnd":307,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/devui/deployment-spi/src/main/java/io/quarkus/devui/spi/buildtime/BuildTimeActionBuildItem.java#L275-L307","documentation":"Thrown by the subscription builder of BuildTimeActionBuildItem at build() when a Dev UI subscription is registered without a backing implementation. Subscriptions differ from plain actions in that they stream updates, so only a deployment function or a runtimeValue is accepted; providing neither leaves the subscription with nothing to push, and the guard rejects it during the extension build.","triggerScenarios":"Building a SubscriptionBuilder with a methodName but no implementation; or trying to supply an assistantFunction which the builder ignores.","commonSituations":"Copy-pasting an ActionBuilder chain into a SubscriptionBuilder, including assistantFunction(...) which does not count as an implementation here.","solutions":["Add .function(...) or .runtime(...) before build()","Remove any assistantFunction(...) call — subscriptions do not support it"],"exampleFix":"// before\nsubscriptionBuilder.assistantFunction(af).build();\n// after\nsubscriptionBuilder.function(map -> computeUpdate()).build();","handlingStrategy":"validation","validationCode":"if (subFunction == null && subRuntimeValue == null) {\n    throw new IllegalArgumentException(\"Provide function or runtimeValue for the subscription\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    subscriptionBuilder.build();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"must be provided\")) { /* attach function or runtime */ }\n    else throw e;\n}","preventionTips":["Remember subscriptions do not support assistantFunction","Ensure each SubscriptionBuilder has function or runtime set"],"tags":["quarkus","devui","jsonrpc","builder-validation"],"backgroundTag":"missing-required-argument","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"}