Conversation
I just have a question - can you explain further what the problem you see is? |
|
Thanks that is clear! |
7a2384c to
acb0c61
Compare
| ) | ||
|
|
||
| func NotFoundByIDError(id string) error { | ||
| NotFoundByIDErr := fmt.Errorf(`Registry instance with ID "%v" not found`, id) |
There was a problem hiding this comment.
It wasn't possible to add localization to those (same as kafka) due to them being used in different context that do not have localiser injected. I think it is good to have those 2 localized and will add that after this PR (it will require a looot of changes that will obfuscate this PR)
There was a problem hiding this comment.
You could create a ServiceRegistryErrors struct to wrap these errors?
|
|
||
| func NotFoundByIDError(id string) error { | ||
| NotFoundByIDErr = fmt.Errorf(`Kafka instance with ID "%v" not found`, id) | ||
| NotFoundByIDErr := fmt.Errorf(`Kafka instance with ID "%v" not found`, id) |
There was a problem hiding this comment.
You could return the error inline?
There was a problem hiding this comment.
Oh.. yes. That was copy paste from kafka errors.
| ) | ||
|
|
||
| func NotFoundByIDError(id string) error { | ||
| NotFoundByIDErr := fmt.Errorf(`Registry instance with ID "%v" not found`, id) |
There was a problem hiding this comment.
You could create a ServiceRegistryErrors struct to wrap these errors?
|
It feels like this was overkill to handle only 3 errors from srs (as all kafka errors were handled already). |

Verification
Notes (outdated)
Current problems I see:
Lack way to handle errors per SDK (API exposing hasError etc.) so we need to define errors in multiple places/defefine them or have helper methods for creating proper message per type.
Errors type should be probably moved to the core and not defined for kafka specifically
SDK on its own defines all errors on root package. Maybe we should have
kafkaerrors.ERROR_40instead?