[IMPROVED] Expose JetStream API error codes to user for better error handling#1977
[IMPROVED] Expose JetStream API error codes to user for better error handling#1977edandavi wants to merge 1 commit intonats-io:mainfrom
Conversation
…andling Signed-off-by: Edan David <edandavi@gmail.com>
|
Sorry to be late here - I think this is a good idea, although I'm wondering if it wouldn't be convenient to have those error codes generated from server (as the server has all error codes listed in json anyway): https://github.com/nats-io/nats-server/blob/main/server/errors.json We could have a template just for generating error codes and we would not have to worry about manually keeping the list up to date. @edandavi would you be up to doing that? |
|
Hi @piotrpio, Sure, I can do it, A possible solution could be to separate the errors JSON into a common mini-repository that would hold the errors, but that would require changes in the server repo too. |
Following this discussion with @wallyqs
this change allows the user to handle all the various jetstream API errors the server may return
like so: