diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-09-02 06:43:37 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-09-02 06:43:37 +0300 |
commit | ae98765937346a5e3675f5276e3f020d1f1c6369 (patch) | |
tree | fa28be97da841ae64e9061a6783f1c4fc82747a8 | |
parent | 29410749d7c0cf68d373d4c324f41a47d7101ce5 (diff) |
fix: handle errortracking init error
-rw-r--r-- | main.go | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -24,8 +24,8 @@ var VERSION = "dev" // REVISION stores the information about the git revision of application var REVISION = "HEAD" -func initErrorReporting(sentryDSN, sentryEnvironment string) { - errortracking.Initialize( +func initErrorReporting(sentryDSN, sentryEnvironment string) error { + return errortracking.Initialize( errortracking.WithSentryDSN(sentryDSN), errortracking.WithVersion(fmt.Sprintf("%s-%s", VERSION, REVISION)), errortracking.WithLoggerName("gitlab-pages"), @@ -55,7 +55,10 @@ func appMain() { } if config.Sentry.DSN != "" { - initErrorReporting(config.Sentry.DSN, config.Sentry.Environment) + err := initErrorReporting(config.Sentry.DSN, config.Sentry.Environment) + if err != nil { + log.WithError(err).Fatal("Failed to initialize errortracking") + } } err = logging.ConfigureLogging(config.Log.Format, config.Log.Verbose) |