Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Expose schema registry errors #11

Open
racevedoo opened this issue Jun 7, 2018 · 1 comment
Open

Expose schema registry errors #11

racevedoo opened this issue Jun 7, 2018 · 1 comment
Assignees

Comments

@racevedoo
Copy link

Hello,

Thanks for this great library!
I was wondering if there's a simple way to check for "subject not found" errors.

I can see that in the IsRegistered method, there's a check for schema not found error:

if ce, confluentErr := err.(confluentError); confluentErr && ce.ErrorCode == schemaNotFound {
	return false, fs, nil
}

But the const subjectNotFound is not used on the project. Is there any reason behind that?

Thanks!

@kataras
Copy link
Contributor

kataras commented Jun 8, 2018

@racevedoo

When #12 will be merged, open your terminal and execute go get -u github.com/landoop/schema-registry/schema-registry-cli to update the package, you now have two helpers for the error type check:

if schemaregistry.IsSubjectNotFound(err) {
 // error raised by subject not found.
}
if schemaregistry.IsSchemaNotFound(err) {
 // error raised by schema not found.
}

Thanks and do not hesitate to ask for more, please do consider our lenses-go too!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants