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

Add on_error handler #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add on_error handler #35

wants to merge 1 commit into from

Conversation

towhans
Copy link

@towhans towhans commented Sep 16, 2024

This allows handling cases when Hammer Backend returns {:error, ...} tuple. For example Hammer.Backend.Redis can return {:error, %Redix.ConnectionError{}} which is not technically an over limit return value but more of a Internal Server Error response.

This will allow to return 500 https status code in case Hammer.Backend returns an {:error, _} which is now impossible because the on_deny handler is called both for :deny and :error The new optional handler can handle error case.

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.

1 participant