open-feature / spec

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

Evaluation Context related error status #141

Closed kinyoklion closed 1 year ago

kinyoklion commented 1 year ago

For some providers contexts are going to require certain attributes to function correctly. For instance a targeting key.

It would be good if there was an error code for context related problems, for instance MALFORMED_CONTEXT.

This would help to more quickly narrow down usage errors.

toddbaert commented 1 year ago

I agree this would be helpful. I'd accept MALFORMED_CONTEXT, but I'll also suggest INVALID_CONTEXT as another possible alternative. "Malformed" suggests to me something like a structural error, while "invalid" implies either structural or semantic issues (like a missing targeting key). I think either work though.

thomaspoignant commented 1 year ago

Yes it would be great to have something like that in the providers to be explicit when a field is missing.

kinyoklion commented 1 year ago

Resolved in https://github.com/open-feature/spec/pull/142