Skip to content

Commit

Permalink
Move error handling for parsing up into the labelCollections service
Browse files Browse the repository at this point in the history
  • Loading branch information
Lesstat committed Aug 1, 2017
1 parent 7112461 commit 8c24419
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ var dsMap map[string]*C.Datastructure
// pRootEndpoint is the path prefix for all label collection
var pRootEndpoint string

// renderdConfigPath contains the path to renderd.conf. It is used for
// the labelCollections endpoint
var renderdConfigPath string

func main() {
Expand Down Expand Up @@ -214,7 +216,7 @@ func getLabelCollections(w http.ResponseWriter, r *http.Request) {
}
tileEndpoints, err := parseEndpoints(renderdConfigPath)
if err != nil {
// TODO: 500 Status
log.Printf("Error during parsing: %s ", err.Error())
}
labelCollection := labelCollectionResult{
pRootEndpoint,
Expand Down
4 changes: 1 addition & 3 deletions tileconfig.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package main

import (
"log"

"github.com/Terry-Mao/goconf"
)

Expand All @@ -20,7 +18,7 @@ func parseEndpoints(file string) ([]tileEndpoint, error) {
conf.Spliter = "="
conf.Comment = ";"
if err := conf.Parse(file); err != nil {
log.Printf("Error during parsing: %s ", err.Error())
return nil, err
}

for _, sectionName := range conf.Sections() {
Expand Down

0 comments on commit 8c24419

Please sign in to comment.