Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Raven panics when using juju errors #255

Open
j-fuentes opened this issue May 2, 2019 · 2 comments
Open

Raven panics when using juju errors #255

j-fuentes opened this issue May 2, 2019 · 2 comments

Comments

@j-fuentes
Copy link

j-fuentes commented May 2, 2019

I am using juju errors in my project and raven-go does not like them.

This example uses standard Go errors:

package main

import (
	"errors"
	"fmt"
	"os"

	"github.com/getsentry/raven-go"
	// "github.com/juju/errors"
)

func main() {
	client, err := raven.New(os.Getenv("SENTRY_DSN"))
	if err != nil {
		panic(err)
	}

	e := errors.New("test")
	s := client.CaptureError(e, nil)
	fmt.Println(s)
}

And it works:

$ go run .
39f60ebda4a946ebb7a2d5d2278f1d2e

However, if I try to use juju errors:

package main

import (
	// "errors"
	"fmt"
	"os"

	"github.com/getsentry/raven-go"
	"github.com/juju/errors"
)

func main() {
	client, err := raven.New(os.Getenv("SENTRY_DSN"))
	if err != nil {
		panic(err)
	}

	e := errors.New("test")
	s := client.CaptureError(e, nil)
	fmt.Println(s)
}

CaptureError panics:

$  go run .
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x727936]

goroutine 1 [running]:
github.com/getsentry/raven-go.NewException(0x0, 0x0, 0xc0001b3e20, 0x3)
        /home/jfuentes/go/src/github.com/getsentry/raven-go/exception.go:12 +0x26
github.com/getsentry/raven-go.(*Client).CaptureError(0xc0000de000, 0x8a8320, 0xc0001ca870, 0x0, 0x0, 0x0, 0x0, 0xc000022118, 0x0)
        /home/jfuentes/go/src/github.com/getsentry/raven-go/client.go:753 +0x2ed
main.main()
        /home/jfuentes/wk/tmp/raven/main.go:19 +0xec
exit status 2
@mattrobenolt
Copy link
Contributor

Which version of raven-go? The line numbers in your stack trace don’t line up to master, so kinda hard to see what’s going on here.

@j-fuentes
Copy link
Author

oh sorry, I forgot to mention that. I have updated to the current master and patched the initial comment with the output.

  • go version go1.12
  • raven-go commit: 919484f

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants