Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-09-02 06:43:37 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-09-02 06:43:37 +0300
commitae98765937346a5e3675f5276e3f020d1f1c6369 (patch)
treefa28be97da841ae64e9061a6783f1c4fc82747a8
parent29410749d7c0cf68d373d4c324f41a47d7101ce5 (diff)
fix: handle errortracking init error
-rw-r--r--main.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.go b/main.go
index 042e5974..7f2529dd 100644
--- a/main.go
+++ b/main.go
@@ -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)