Skip to content

Commit

Permalink
minor error message text change for config validatoin. #94
Browse files Browse the repository at this point in the history
  • Loading branch information
ARolek committed Oct 5, 2017
1 parent 724b86f commit b029a0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ func (e ErrInvalidProviderLayerName) Error() string {
return fmt.Sprintf("config: invalid provider layer name (%v)", e.ProviderLayerName)
}

type ErrLayerCollision struct {
type ErrOverlappingLayerZooms struct {
ProviderLayer1 string
ProviderLayer2 string
}

func (e ErrLayerCollision) Error() string {
return fmt.Sprintf("config: layer collision (%v) and (%v)", e.ProviderLayer1, e.ProviderLayer2)
func (e ErrOverlappingLayerZooms) Error() string {
return fmt.Sprintf("config: overlapping zooms for layer (%v) and layer (%v)", e.ProviderLayer1, e.ProviderLayer2)
}

// A Config represents the a Tegola Config file.
Expand Down Expand Up @@ -105,7 +105,7 @@ func (c *Config) Validate() error {
if val, ok := layerNames[name]; ok {
// we have a hit. check for zoom range overlap
if val.MinZoom <= l.MaxZoom && l.MinZoom <= val.MaxZoom {
return ErrLayerCollision{
return ErrOverlappingLayerZooms{
ProviderLayer1: val.ProviderLayer,
ProviderLayer2: l.ProviderLayer,
}
Expand Down
4 changes: 2 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func TestValidate(t *testing.T) {
},
},
},
expected: config.ErrLayerCollision{
expected: config.ErrOverlappingLayerZooms{
ProviderLayer1: "provider1.water",
ProviderLayer2: "provider2.water",
},
Expand Down Expand Up @@ -363,7 +363,7 @@ func TestValidate(t *testing.T) {
},
},
},
expected: config.ErrLayerCollision{
expected: config.ErrOverlappingLayerZooms{
ProviderLayer1: "provider1.water_0_5",
ProviderLayer2: "provider2.water_5_10",
},
Expand Down

0 comments on commit b029a0b

Please sign in to comment.