{"record":{"id":"94daeb4dbcb708bd","repo":"quarkusio/quarkus","slug":"only-one-server-errorinterceptor-is-supported","errorCode":null,"errorMessage":"Only one server ErrorInterceptor is supported","messagePattern":"Only one server ErrorInterceptor is supported","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java","lineNumber":107,"sourceCode":"            var pathToInterceptor2 = this.pathToServerConnectionInterceptor;\n            this.pathToServerConnectionInterceptor = new Function<>() {\n                @Override\n                public ConnectionInterceptor apply(String path) {\n                    var interceptor1 = pathToInterceptor1.apply(path);\n                    var interceptor2 = pathToInterceptor2.apply(path);\n                    return new CompositeConnectionInterceptor(List.of(interceptor1, interceptor2));\n                }\n            };\n        }\n    }\n\n    void pathToServerErrorInterceptor(Function<String, ErrorInterceptor> pathToServerErrorInterceptor) {\n        Objects.requireNonNull(pathToServerErrorInterceptor);\n        if (this.pathToServerErrorInterceptor == null) {\n            this.pathToServerErrorInterceptor = pathToServerErrorInterceptor;\n        } else {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one server ErrorInterceptor is supported\");\n        }\n    }\n\n    void pathToClientErrorInterceptor(Function<String, ErrorInterceptor> pathToClientErrorInterceptor) {\n        Objects.requireNonNull(pathToClientErrorInterceptor);\n        if (this.pathToClientErrorInterceptor == null) {\n            this.pathToClientErrorInterceptor = pathToClientErrorInterceptor;\n        } else {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one client ErrorInterceptor is supported\");\n        }\n    }\n\n    void pathToServerSendingInterceptor(Function<String, SendingInterceptor> pathToServerSendingInterceptor) {\n        Objects.requireNonNull(pathToServerSendingInterceptor);\n        if (this.pathToServerSendingInterceptor == null) {\n            this.pathToServerSendingInterceptor = pathToServerSendingInterceptor;\n        } else {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java#L89-L125","documentation":"WebSocketTelemetryProviderBuilder allows exactly one server ErrorInterceptor provider. A second call to pathToServerErrorInterceptor() (i.e. a second telemetry/decorating provider attempting to install a server error interceptor) throws IllegalStateException, since composition is not implemented.","triggerScenarios":"Registering two telemetry providers (or a provider plus a custom one) that both supply a server ErrorInterceptor — e.g. quarkus-websockets-next telemetry combined with opentelemetry and a custom ErrorInterceptor, or duplicate provider beans.","commonSituations":"Having both an OTel-based telemetry provider and a custom ErrorInterceptor on the classpath; multiple @ApplicationScoped beans implementing the provider extension point.","solutions":["Remove or disable one of the providers supplying a server ErrorInterceptor","Merge the two interceptors into a single composite implementation of your own and register only that one","Use quarkus.observability / telemetry config to disable one provider's interceptor"],"exampleFix":"// before\ntelemetryProviderBuilder.pathToServerErrorInterceptor(f1);\ntelemetryProviderBuilder.pathToServerErrorInterceptor(f2); // throws\n// after\nFunction<String, ErrorInterceptor> composite = path -> msg -> {\n    try { return f1.apply(path).handle(msg); }\n    finally { f2.apply(path).handle(msg); }\n};\ntelemetryProviderBuilder.pathToServerErrorInterceptor(composite);","handlingStrategy":"validation","validationCode":"// check classpath for multiple telemetry providers before build\nduplicateInterceptors.forEach(f -> checkOnlyOneRegistered());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Register only one server ErrorInterceptor provider at a time","Audit dependencies for multiple websockets-next telemetry providers (e.g. OTel plus custom)","Fold multiple interceptors into one composite provider"],"tags":["websockets","telemetry","error-interceptor","configuration-conflict"],"backgroundTag":"duplicate-provider-registration","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"}