Skip to content

Standardise FlagNotFound error #42

Description

@Zaimwa9

Problem
Currently, when a flag key isn't found, the SDK returns a generic FlagsmithAPIError with the message API returned invalid response.
This forces consumers (cf OpenFeature crate) to rely on fragile string matching to detect this case.

Proposed solution
Add a FlagNotFound variant to ErrorKind and return it from Flags::get_flag when the key doesn't exist in the HashMap.

Requirements

  • Add FlagNotFound error kind and return it from Flags::get_flag
  • Update the OpenFeature provider to use the new error kind instead of string matching

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions