Created
March 26, 2020 07:30
-
-
Save tkc/c4c886fb8abb2218ba3963b7cc349787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"log" | |
"time" | |
"github.com/getsentry/sentry-go" | |
) | |
func main() { | |
err := sentry.Init(sentry.ClientOptions{ | |
Dsn: "your auth key", | |
}) | |
if err != nil { | |
log.Fatalf("sentry.Init: %s", err) | |
} | |
defer sentry.Flush(2 * time.Second) | |
sentry.WithScope(func(scope *sentry.Scope) { | |
scope.SetLevel(sentry.LevelFatal) | |
sentry.CaptureException(errors.New("example error")) | |
}) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment