Browse Source

Expose 'value does not exists' error

pull/34/head
Vincent Batoufflet 9 years ago
parent
commit
ed47c630bf
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      section.go

+ 6
- 1
section.go View File

@ -8,6 +8,11 @@ import (
"strings"
)
var (
// ErrNotExists represents a nonexistent value error
ErrNotExists = errors.New("value does not exist")
)
// Section struct holds a map of values
type Section struct {
comments []string
@ -95,7 +100,7 @@ func (section *Section) Get(name string) (Value, error) {
value, ok := section.values[name]
var err error
if ok == false {
err = errors.New("value does not exist")
err = ErrNotExists
}
return value, err
}


Loading…
Cancel
Save