# README
Sentry Package
This is a simple sentry wrapper.
Usage in Apps
package main
import (
"errors"
"github.com/useinsider/go-pkg/inssentry"
"time"
)
func main() {
sentrySettings := inssentry.Settings{
SentryDsn: "sentry_dsn",
AttachStacktrace: true,
FlushInterval: 2 * time.Second,
IsProduction: false,
}
err := inssentry.Init(sentrySettings)
if err != nil {
panic(err)
}
defer inssentry.Flush()
inssentry.Error(errors.New("test_error"))
}
# Functions
Error sends the error to sentry.
ErrorWithAdditionalData sends the error to sentry with additional data.
Fatal sends the error to sentry and exit from the program.
Flush sends the collected sentry messages to sentry.
Init caches the settings and opens the sentry client.