Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a configurable error handler for environment updates. Return response codes on HTTP errors #140

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

ajinkyasurya
Copy link
Contributor

  • Adds a pollErrorHandler func(error) to Client struct.
  • Instead of just logging exception in pollEnvironment(), trigger callback function when UpdateEnvironment fails.

* Remove handler from pollEnvironment to UpdateEnvironment
* Rename handler to errorHandler
* Create a struct FlagsmithErrorHandler so that we can return error and other client response details
Copy link
Member

@rolodato rolodato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach looks good, but I'd like to finalise the types/names with feedback from @gagantrivedi 👍

client_test.go Outdated Show resolved Hide resolved
errors.go Outdated Show resolved Hide resolved
@ajinkyasurya ajinkyasurya changed the title feat: Add pollErrorHandler to handle pollEnvironment errors feat: Add errorHandler to handle UpdateEnvironment() errors Sep 27, 2024
@rolodato rolodato changed the title feat: Add errorHandler to handle UpdateEnvironment() errors feat: Add a configurable error handler for environment updates. Return response codes on HTTP errors Sep 30, 2024
@rolodato rolodato merged commit a6faf98 into Flagsmith:main Sep 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants