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

transport_failure_callback gives no information on failure reason #661

Closed
Zoetermeer opened this issue Apr 13, 2017 · 5 comments
Closed
Assignees
Projects
Milestone

Comments

@Zoetermeer
Copy link

All we are given in this callback is the hash version of the event we originally intended to send, but it would be useful to also be given the exception that caused the send failure as an additional argument. Otherwise we have no idea why the request failed in the first place.

@nateberkopec nateberkopec mentioned this issue May 10, 2017
8 tasks
@nateberkopec nateberkopec modified the milestone: 3.0.0 May 24, 2017
@EtienneDepaulis
Copy link
Contributor

Hello @nateberkopec I would be happy to help on this issue as it impacts us.
Is a PR on the current the best approach for you ?

@nateberkopec
Copy link
Contributor

@EtienneDepaulis Yes please!

@EtienneDepaulis
Copy link
Contributor

I've finally took the time to look at the code and I as I'm no ruby expert I would like to have your opinion on the best approach:

Here is the code responsible for calling the transport_failure_callback proc:

def failed_send(e, event)
  @state.failure
  if e # exception was raised
    configuration.logger.error "Unable to record event with remote Sentry server (#{e.class} - #{e.message}):\n#{e.backtrace[0..10].join("\n")}"
  else
    configuration.logger.error "Not sending event due to previous failure(s)."
  end
  configuration.logger.error("Failed to submit event: #{get_log_message(event)}")
  configuration.transport_failure_callback.call(event) if configuration.transport_failure_callback
end

We are interested in the properties of the error raised passed to this method by e. The problem is that transport_failure_callback expects only one param and doing something like configuration.transport_failure_callback.call(event, e) would be a breaking change.
But as mentioned, this feature is supposed to be introduced in v3, so those kind of changes are acceptable.

Another option would be to store the exception in the context of the event (extra section).

Which approche seems better for you @nateberkopec ?

@nateberkopec
Copy link
Contributor

@EtienneDepaulis Open a PR with a breaking change against the v3 branch, please.

@st0012 st0012 modified the milestones: 3.0.0, 3.0.1 Aug 6, 2020
@st0012 st0012 added this to Needs triage in 3.x via automation Aug 14, 2020
@st0012 st0012 moved this from Needs triage to Medium priority in 3.x Aug 14, 2020
@st0012 st0012 moved this from Medium priority to Needs Porting in 3.x Aug 14, 2020
@st0012 st0012 modified the milestones: 3.0.1, 3.1.0 Aug 14, 2020
@st0012 st0012 self-assigned this Aug 28, 2020
@st0012
Copy link
Collaborator

st0012 commented Sep 3, 2020

close with #1003

@st0012 st0012 closed this as completed Sep 3, 2020
3.x automation moved this from Needs Porting From V3 Branch to Closed Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3.x
  
Closed
Development

No branches or pull requests

4 participants