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

Document typed errors returned by interfaces #1528

Open
japem opened this issue Jan 18, 2024 · 0 comments
Open

Document typed errors returned by interfaces #1528

japem opened this issue Jan 18, 2024 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@japem
Copy link

japem commented Jan 18, 2024

Observed behavior

The interfaces defined by the jetstream package (and possibly others though I haven't looked into them) do not document the typed errors that they may return. This makes it difficult to use the error types defined in this package to drive behavior after calling the interface methods.

For example, looking at the code I can see that the main implementation of KeyValue.Create() will return ErrKeyExists if the key exists at the time create is called. This should be documented as a requirement of the interface so consumers can rely on this error type being returned and handle it appropriately.

Expected behavior

Typed errors returned by any method should be documented.

Server and client version

github.com/nats-io/nats.go v1.31.0

Host environment

N/A

Steps to reproduce

N/A

@japem japem added the defect Suspected defect such as a bug or regression label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant