Added errors for services
This commit is contained in:
parent
ab4b53fd40
commit
c3c3d65d32
12 changed files with 217 additions and 86 deletions
15
internal/application/errors/already_exists_error.go
Normal file
15
internal/application/errors/already_exists_error.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package errors
|
||||
|
||||
type AlreadyExistsError struct {
|
||||
msg string
|
||||
}
|
||||
|
||||
func NewAlreadyExistsError(msg string) *AlreadyExistsError {
|
||||
return &AlreadyExistsError{
|
||||
msg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
func (e *AlreadyExistsError) Error() string {
|
||||
return "Already exists: " + e.msg
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue