{"record":{"id":"91f47bdafd851838","repo":"quarkusio/quarkus","slug":"only-one-client-errorinterceptor-is-supported","errorCode":null,"errorMessage":"Only one client ErrorInterceptor is supported","messagePattern":"Only one client 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":117,"sourceCode":"    }\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 {\n            // we can implement composite if we need this in the future\n            throw new IllegalStateException(\"Only one server SendingInterceptor is supported\");\n        }\n    }\n\n    void pathToClientSendingInterceptor(Function<String, SendingInterceptor> pathToClientSendingInterceptor) {\n        Objects.requireNonNull(pathToClientSendingInterceptor);\n        if (this.pathToClientSendingInterceptor == null) {\n            this.pathToClientSendingInterceptor = pathToClientSendingInterceptor;\n        } else {","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/telemetry/WebSocketTelemetryProviderBuilder.java#L99-L135","documentation":"WebSocketTelemetryProviderBuilder allows registering exactly one Function<String, ErrorInterceptor> that maps endpoint paths to client error interceptors. A second registration (when one is already set) throws this IllegalStateException because compositing interceptors is not implemented. The comment notes composite support may be added in the future.","triggerScenarios":"Calling pathToClientErrorInterceptor(...) a second time after a Function has already been stored on the builder instance.","commonSituations":"Two telemetry/integration extensions (e.g. tracing + metrics) both registering their own client error interceptor via this runtime-builder API; duplicated initialization in application code or a repeated recorder callback.","solutions":["Ensure only one component registers pathToClientErrorInterceptor on the builder","Merge your interceptor logic into a single Function before registering","Check which extensions/features contribute interceptors and disable duplicates"],"exampleFix":"// before\nbuilder.pathToClientErrorInterceptor(a);\nbuilder.pathToClientErrorInterceptor(b); // throws\n// after\nbuilder.pathToClientErrorInterceptor(path -> path.startsWith(\"/ws\") ? b.apply(path) : a.apply(path));","handlingStrategy":"validation","validationCode":"if (builder.pathToClientErrorInterceptor != null) throw new IllegalStateException(\"already registered\");","typeGuard":null,"tryCatchPattern":"try { builder.pathToClientErrorInterceptor(fn); } catch (IllegalStateException e) { /* handle duplicate */ }","preventionTips":["Single registration site per interceptor type"],"tags":["websockets","interceptor","configuration"],"backgroundTag":"duplicate-interceptor-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"}