change config.env to config.servername
This commit is contained in:
parent
a597270424
commit
3cf660b0c4
|
@ -4,7 +4,7 @@ import "errors"
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Dsn string
|
Dsn string
|
||||||
Env string
|
ServerName 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.Env == "" {
|
if c.ServerName == "" {
|
||||||
return errors.New("sentry ENV is required")
|
return errors.New("sentry SERVER_NAME is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -16,7 +16,7 @@ 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,
|
||||||
Environment: cfg.Env,
|
ServerName: cfg.ServerName,
|
||||||
}); 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
|
||||||
|
|
Loading…
Reference in New Issue