Skip to content

Commit

Permalink
update errors
Browse files Browse the repository at this point in the history
  • Loading branch information
da440dil committed Aug 5, 2019
1 parent 462e916 commit 768ac39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ type Gateway interface {
}

// ErrInvalidTTL is the error returned when NewCounter receives invalid value of TTL.
var ErrInvalidTTL = errors.New("TTL must be greater than or equal to 1 millisecond")
var ErrInvalidTTL = errors.New("counter: TTL must be greater than or equal to 1 millisecond")

// ErrInvalidLimit is the error returned when NewCounter receives invalid value of limit.
var ErrInvalidLimit = errors.New("Limit must be greater than zero")
var ErrInvalidLimit = errors.New("counter: limit must be greater than zero")

// ErrInvalidKey is the error returned when key size is greater than 512 MB.
var ErrInvalidKey = errors.New("Key size must be less than or equal to 512 MB")
var ErrInvalidKey = errors.New("counter: key size must be less than or equal to 512 MB")

// Option is function returned by functions for setting options.
type Option func(c *Counter) error
Expand Down
4 changes: 2 additions & 2 deletions redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
)

// ErrInvalidResponse is the error returned when Redis command returns response of invalid type.
var ErrInvalidResponse = errors.New("Invalid response")
var ErrInvalidResponse = errors.New("counter/redis: invalid response")

// ErrKeyNameClash is the error returned when Redis key exists and has no TTL.
var ErrKeyNameClash = errors.New("Key name clash")
var ErrKeyNameClash = errors.New("counter/redis: key name clash")

var incr = redis.NewScript(
"local v = redis.call(\"incr\", KEYS[1]) " +
Expand Down

0 comments on commit 768ac39

Please sign in to comment.