Skip to content

Commit

Permalink
config: add new error type
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
  • Loading branch information
vtolstov committed Nov 30, 2021
1 parent 8a2e84d commit 326ee53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var (
ErrInvalidStruct = errors.New("invalid struct specified")
// ErrWatcherStopped is returned when source watcher has been stopped
ErrWatcherStopped = errors.New("watcher stopped")
// ErrWatcherNotImplemented returned when config does not implement watch
ErrWatcherNotImplemented = errors.New("watcher not implemented")
)

// Config is an interface abstraction for dynamic configuration
Expand Down
3 changes: 1 addition & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"context"
"fmt"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -271,7 +270,7 @@ func (c *defaultConfig) Name() string {
}

func (c *defaultConfig) Watch(ctx context.Context, opts ...WatchOption) (Watcher, error) {
return nil, fmt.Errorf("not implemented")
return nil, ErrWatcherNotImplemented
}

// NewConfig returns new default config source
Expand Down

0 comments on commit 326ee53

Please sign in to comment.