harness-community / openfeature-java-provider

Apache License 2.0
0 stars 1 forks source link

OF Provider 2.8 #17

Open scalabl3 opened 1 year ago

scalabl3 commented 1 year ago

https://docs.openfeature.dev/docs/specification/sections/providers#requirement-28

Requirement 2.8 In cases of abnormal execution, the provider MUST indicate an error using the idioms of the implementation language, with an associated error code and optional associated error message.

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.

See error code for details.

// example throwing an exception with an error code and optional error message.
throw new ProviderError(ErrorCode.INVALID_CONTEXT, "The 'foo' attribute must be a string.");

Reference Provider (JAVA): https://github.com/splitio/split-openfeature-provider-java/blob/main/src/main/java/io/split/openfeature/SplitProvider.java

Conventions Checklist: https://docs.openfeature.dev/docs/reference/concepts/provider/#checklist