Giter Site home page Giter Site logo

Comments (5)

ashutosh-narkar avatar ashutosh-narkar commented on May 23, 2024

The ability to return an error seems like a good idea.

a backwards compatible change would be introducing a second interface that can validate tracing.Options

Are you suggesting a new Validate method on the Options type? This would also work, correct?

from opa.

mjungsbluth avatar mjungsbluth commented on May 23, 2024

Are you suggesting a new Validate method on the Options type? This would also work, correct?

That is also possible but is also a breaking change as far as I can see it. I was more thinking of another interface with a validate method that implementations HTTPTracingService can implement.

I am actually not sure how much concern just adding error as return type is as this interface is pretty specific to library use and also easy to fix (just return nil as err in the changed method signature)

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on May 23, 2024

I am actually not sure how much concern just adding error as return type is as this interface is pretty specific to library use and also easy to fix (just return nil as err in the changed method signature)

You're probably correct but we don't know the impact of the breaking change. So another interface that returns an error and maybe takes a context as input if it makes sense would be better. We can deprecate the old one.

As the tracing options are passed as an untyped array, errors in construction of these options can happen.

Question: Where does the validation happen? Inside the NewTransport implementation?

from opa.

mjungsbluth avatar mjungsbluth commented on May 23, 2024

Question: Where does the validation happen? Inside the NewTransport implementation?

In my case yes. Causes can be type mismatches or missing elements.

from opa.

ashutosh-narkar avatar ashutosh-narkar commented on May 23, 2024

Ok. So a new interface that returns an error and deprecating the old seems like a good option to me.

from opa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.