mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
make seperate error commands depending on if a channel or a command already exists
This commit is contained in:
parent
350283018e
commit
88b114a826
|
@ -69,7 +69,7 @@ func (c ChannelModel) Insert(channel *Channel) error {
|
|||
}
|
||||
|
||||
if rowsAffected == 0 {
|
||||
return ErrRecordAlreadyExists
|
||||
return ErrChannelRecordAlreadyExists
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -66,7 +66,7 @@ func (c CommandModel) Insert(name, text string) error {
|
|||
}
|
||||
|
||||
if rowsAffected == 0 {
|
||||
return ErrRecordAlreadyExists
|
||||
return ErrCommandRecordAlreadyExists
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -7,7 +7,8 @@ import (
|
|||
|
||||
var (
|
||||
ErrRecordNotFound = errors.New("record not found")
|
||||
ErrRecordAlreadyExists = errors.New("channel already in database")
|
||||
ErrChannelRecordAlreadyExists = errors.New("channel already in database")
|
||||
ErrCommandRecordAlreadyExists = errors.New("command already exists")
|
||||
ErrUserAlreadyExists = errors.New("user already in database")
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue