Skip to content

Improve error message for subject overlap errors (ErrorCode 10065) #1498

@samueljoli

Description

@samueljoli

Proposal

Problem
When creating a JetStream stream fails due to subject overlap (error code 10065), the error message only says "subjects overlap with an existing stream" without providing context about which stream we were trying to create or what subjects were involved.

Example current error:

  Error { kind: JetStream(Error { code: 400, err_code: ErrorCode(10065),
  description: Some("subjects overlap with an existing stream") }), source: None }

This requires developers to manually trace back through their code to understand which stream creation failed and what subjects were involved.

Use case

Proposed Enhancement
Enhance the error message to include the attempted stream name and subjects from the configuration, making debugging significantly easier.

Contribution

Yes,

Example improved error:
Failed to create stream 'my-stream' with subjects ["orders.", "shipments."]:
subjects overlap with an existing stream

Ideally it would be nice to also surface the stream along with the exact subject in question but not sure if the juice is worth the squeeze or how much of a lift that would be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalEnhancement idea or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions