Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change jetstream::Error's Display message #1365

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

thinety
Copy link
Contributor

@thinety thinety commented Jan 27, 2025

The current Display message for jetstream::Error is a little confusing. For example, this piece of code:

#[tokio::main]
async fn main() -> Result<(), async_nats::Error> {
    let client = async_nats::connect("localhost:4222").await?;
    let jetstream = async_nats::jetstream::new(client);
    if let Err(err) = jetstream.get_object_store("nonexistent").await {
        eprintln!("{}", err);
    }
    Ok(())
}

prints

failed to get Object Store: jetstream error: 404 (code stream not found, error code 10059)

After this change, the message is:

failed to get Object Store: jetstream error: stream not found (code 404, error code 10059)

@Jarema Jarema force-pushed the change-display-jetstream-error branch from ebf0141 to 5b10e6b Compare January 29, 2025 12:41
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement, thanks!

LGTM!

@Jarema Jarema merged commit ba03616 into nats-io:main Jan 29, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants