riferrei / srclient

Golang Client for Schema Registry
Apache License 2.0
236 stars 70 forks source link

improve handling errors from schema registry api #60

Closed biryukovmaxim closed 2 years ago

biryukovmaxim commented 2 years ago

Whant use something like that:

var srcErr srclient.Error
    schema, err := c.schemaRegistryClient.GetLatestSchema(topicName)
    if err != nil && errors.As(err, &srcErr) && srcErr.Code != 40401 {
        return err
    }

if Code == 40401 needs to create schema

I sent PR to solve it https://github.com/riferrei/srclient/pull/59