-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added error key not found if Get not returned value
- Loading branch information
Gabriel Cataldo
committed
Mar 12, 2024
1 parent
3895b06
commit 3245dcc
Showing
4 changed files
with
31 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,17 @@ | ||
package redis | ||
|
||
import ( | ||
"github.com/GabrielHCataldo/go-errors/errors" | ||
"errors" | ||
) | ||
|
||
var MsgErrConvertKey = "redis: error convert key to string" | ||
var MsgErrConvertKeyIndex = "redis: error convert key to string on index:" | ||
var MsgErrConvertNewKey = "redis: error convert new key to string" | ||
var MsgErrConvertValue = "redis: error convert value" | ||
var MsgErrDestIsNotPointer = "redis: dest is not pointer" | ||
var MsgErrKeyNotFound = "redis: key not exists" | ||
var MsgErrKeyNotFound = "redis: key not found" | ||
|
||
var ErrConvertKey = errors.New(MsgErrConvertKey) | ||
var ErrConvertKeyIndex = errors.New(MsgErrConvertKeyIndex) | ||
var ErrConvertNewKey = errors.New(MsgErrConvertNewKey) | ||
var ErrConvertValue = errors.New(MsgErrConvertValue) | ||
var ErrDestIsNotPointer = errors.New(MsgErrDestIsNotPointer) | ||
var ErrKeyNotFound = errors.New(MsgErrKeyNotFound) | ||
|
||
func errConvertKey(skip int) error { | ||
ErrConvertKey = errors.NewSkipCaller(skip+1, MsgErrConvertKey) | ||
return ErrConvertKey | ||
} | ||
|
||
func errConvertKeyIndex(skip, index int) error { | ||
ErrConvertKeyIndex = errors.NewSkipCaller(skip+1, MsgErrConvertKeyIndex, index) | ||
return ErrConvertKeyIndex | ||
} | ||
|
||
func errConvertNewKey(skip int) error { | ||
ErrConvertNewKey = errors.NewSkipCaller(skip+1, MsgErrConvertNewKey) | ||
return ErrConvertNewKey | ||
} | ||
|
||
func errConvertValue(skip int) error { | ||
ErrConvertValue = errors.NewSkipCaller(skip+1, MsgErrConvertValue) | ||
return ErrConvertValue | ||
} | ||
|
||
func errDestIsNotPointer(skip int) error { | ||
ErrDestIsNotPointer = errors.NewSkipCaller(skip+1, MsgErrDestIsNotPointer) | ||
return ErrDestIsNotPointer | ||
} | ||
|
||
func errKeyNotFound(skip int) error { | ||
ErrKeyNotFound = errors.NewSkipCaller(skip+1, MsgErrKeyNotFound) | ||
return ErrKeyNotFound | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters