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:
authorJaime Martinez <jmartinez@gitlab.com>2020-12-10 09:38:29 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-01-20 04:23:45 +0300
commitce03560d89e7315e24e6ade1fcb5ec14f0c82e39 (patch)
tree122ac1384d18dd43124bcb334c409cfd1b50d461 /internal/logging
parent0501f0ad4c1f99de77d0547379c9c30c75cb007c (diff)
Add more test cases for resolver errors
Fix imports and enable test
Diffstat (limited to 'internal/logging')
-rw-r--r--internal/logging/logging.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/logging/logging.go b/internal/logging/logging.go
index 9ac3c863..43fe65e6 100644
--- a/internal/logging/logging.go
+++ b/internal/logging/logging.go
@@ -4,7 +4,6 @@ import (
"net/http"
"github.com/sirupsen/logrus"
-
"gitlab.com/gitlab-org/labkit/log"
"gitlab.com/gitlab-org/gitlab-pages/internal/request"
@@ -61,13 +60,14 @@ func getExtraLogFields(r *http.Request) log.Fields {
if d := request.GetDomain(r); d != nil {
lp, err := d.GetLookupPath(r)
- if lp != nil {
- logFields["pages_project_serving_type"] = lp.ServingType
- logFields["pages_project_prefix"] = lp.Prefix
- logFields["pages_project_id"] = lp.ProjectID
- } else if err != nil {
+ if err != nil {
logFields["error"] = err.Error()
+ return logFields
}
+
+ logFields["pages_project_serving_type"] = lp.ServingType
+ logFields["pages_project_prefix"] = lp.Prefix
+ logFields["pages_project_id"] = lp.ProjectID
}
return logFields