Skip to content

[ENHANCEMENT] Error hooks only run if the provider throws #1085

Description

@toddbaert

Observed behavior

The error hooks only runs if the provider throws an exception. However, it's possible for a provider to return an error code in the ResolutionDetails. For clarity and flexibilty, we should consider resolutions that return an error code as errors; this will allow providers to signal errors without creating expensive strack traces, as well.

Expected Behavior

The error hook runs and resolution is considered erroneous if the ResolutionDetails contains an errorCode

Steps to reproduce

  1. Register a provider that returns a ResolutionDetails object with an errorCode
  2. Register a hook that relies on the error hook
  3. Evaluate a flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions