Refactor errros package

This commit is contained in:
Andrey Chervyakov 2021-03-15 22:24:17 +06:00
parent db6f98ba79
commit f166ffab3c

View file

@ -1,13 +1,5 @@
package errors package errors
type NotFoundError struct {
Message string
}
func (err NotFoundError) Error() string {
return err.Message
}
type UnknownError struct { type UnknownError struct {
Err error Err error
} }
@ -16,6 +8,18 @@ func (err UnknownError) Error() string {
return err.Err.Error() return err.Err.Error()
} }
func (err UnknownError) Unwrap() error {
return err.Err
}
type NotFoundError struct {
Message string
}
func (err NotFoundError) Error() string {
return err.Message
}
type AlreadyExistsError struct { type AlreadyExistsError struct {
Message string Message string
} }