Compare commits

..

No commits in common. "master" and "v0.0.1" have entirely different histories.

2 changed files with 6 additions and 6 deletions

View File

@ -3,8 +3,8 @@ package sentry
import "errors" import "errors"
type Config struct { type Config struct {
Dsn string Dsn string
ServerName string Env string
} }
func (c Config) validate() error { func (c Config) validate() error {
@ -12,8 +12,8 @@ func (c Config) validate() error {
return errors.New("sentry DNS is required") return errors.New("sentry DNS is required")
} }
if c.ServerName == "" { if c.Env == "" {
return errors.New("sentry SERVER_NAME is required") return errors.New("sentry ENV is required")
} }
return nil return nil

View File

@ -15,8 +15,8 @@ func WithEcho(e *echo.Echo, cfg Config) error {
} }
if err := sentry.Init(sentry.ClientOptions{ if err := sentry.Init(sentry.ClientOptions{
Dsn: cfg.Dsn, Dsn: cfg.Dsn,
ServerName: cfg.ServerName, Environment: cfg.Env,
}); err != nil { }); err != nil {
fmt.Printf("[sentry] initialization failed: %s \n", err.Error()) fmt.Printf("[sentry] initialization failed: %s \n", err.Error())
return err return err