Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0acd857ab5 |
@@ -17,8 +17,8 @@ var sentryInit = sentry.Init
|
|||||||
|
|
||||||
func SetupSentry(logger log.Interface, releaseName string, args SentryConfig) error {
|
func SetupSentry(logger log.Interface, releaseName string, args SentryConfig) error {
|
||||||
if args.Disabled {
|
if args.Disabled {
|
||||||
logger.Info("Sentry disabled, skipping setup")
|
logger.Info("Sentry disabled, setup using empty options")
|
||||||
return nil
|
return sentryInit(sentry.ClientOptions{})
|
||||||
}
|
}
|
||||||
if args.Environment == "" {
|
if args.Environment == "" {
|
||||||
return fmt.Errorf("no Sentry environment supplied, exiting")
|
return fmt.Errorf("no Sentry environment supplied, exiting")
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ func TestSetupSentry(t *testing.T) {
|
|||||||
},
|
},
|
||||||
init: nil,
|
init: nil,
|
||||||
wantErr: assert.NoError,
|
wantErr: assert.NoError,
|
||||||
wantLogged: []string{"info: Sentry disabled, skipping setup"},
|
wantLogged: []string{"info: Sentry disabled, setup using empty options"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no environment",
|
name: "no environment",
|
||||||
|
|||||||
Reference in New Issue
Block a user