getsentry / raven-go

Sentry client in Go
https://sentry.io
BSD 3-Clause "New" or "Revised" License
561 stars 148 forks source link

runtime.Caller() - Propegate line number and stack trace up to main package #89

Open HeathNaylor opened 8 years ago

HeathNaylor commented 8 years ago

My scenario is as follows. I have a package main and a package mylibrary. I have code in mylibrary that has the raven-go package imported and configured. I then run raven.CaptureAndWait().

I run my application that I have compiled (which runs func main() from package main). The package main imports mylibrary and the func main() makes a call to a visible function inside of mylibrary. In the event that an error is encoutered the raven.CaptureAndWait() is ran and the event is sent to Sentry. When I look in Sentry I see the line number in package main but not the line that caused the actual error in mylibrary. Is this an implementation issue with runtime.Caller() or am I implementing this incorrectly?