* add ErrReactionAlreadyExist * extend FindReactionsOptions * createReaction check if exit before create
This commit is contained in:
parent
b4b8c9679f
commit
c63a80138a
3 changed files with 51 additions and 12 deletions
|
@ -1104,6 +1104,21 @@ func (err ErrNewIssueInsert) Error() string {
|
|||
return err.OriginalError.Error()
|
||||
}
|
||||
|
||||
// ErrReactionAlreadyExist is used when a existing reaction was try to created
|
||||
type ErrReactionAlreadyExist struct {
|
||||
Reaction string
|
||||
}
|
||||
|
||||
// IsErrReactionAlreadyExist checks if an error is a ErrReactionAlreadyExist.
|
||||
func IsErrReactionAlreadyExist(err error) bool {
|
||||
_, ok := err.(ErrReactionAlreadyExist)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrReactionAlreadyExist) Error() string {
|
||||
return fmt.Sprintf("reaction '%s' already exists", err.Reaction)
|
||||
}
|
||||
|
||||
// __________ .__ .__ __________ __
|
||||
// \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
|
||||
// | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue