open-feature / spec

OpenFeature specification
https://openfeature.dev
Apache License 2.0
597 stars 35 forks source link

Provider error handling #128

Closed justinabrahms closed 1 year ago

justinabrahms commented 1 year ago

I don't think we're really saying they should handle any and all exceptions.. right? The OF SDK should be dealing with exception handling.

toddbaert commented 1 year ago

I don't think we're really saying they should handle any and all exceptions.. right? The OF SDK should be dealing with exception handling.

It says the provider should indicate an error, not handle them. As in it should use whatever language idioms are appropriate to signal to the caller that something went wrong. This could be throwing an exception. We're trying to be general here since not all languages have try/catch semantics (golang, C). The non-normative text belong expands on this:

The provider might throw an exception, return an error, or populate the error code object on the returned flag resolution structure to indicate a problem during flag value resolution.

justinabrahms commented 1 year ago

Gotcha. That feels reasonable to me.