Skip to content

Conversation

mitchellhenke
Copy link
Contributor

Closes #166

@mitchellhenke mitchellhenke requested a review from jeregrine June 27, 2017 16:14
@@ -157,6 +163,22 @@ defmodule Sentry.Client do
{endpoint, public_key, secret_key}
end

def maybe_call_after_send_event({:ok, _} = result, event) do
case Application.get_env(:sentry, :after_send_event) do
Copy link
Contributor

Choose a reason for hiding this comment

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

Can probably break this case into a function and use it for both scenarios instead of copying it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they each call the configured function differently because of different arities, so this makes less sense now right?

@@ -157,6 +163,22 @@ defmodule Sentry.Client do
{endpoint, public_key, secret_key}
end

def maybe_call_after_send_event({:ok, _} = result, event) do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeregrine Right now we only try to call the hook if the sending event was successful, but I was thinking since we're passing the result, we could call function.(result, event) and let the user decide so we can skip the logic on our side?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me

@mitchellhenke mitchellhenke merged commit f1400d6 into master Jun 27, 2017
@mitchellhenke mitchellhenke deleted the post-event-hook branch June 27, 2017 18:41
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.

2 participants