17 lines
316 B
Go
17 lines
316 B
Go
|
|
package errors
|
||
|
|
|
||
|
|
type NotExistError struct {
|
||
|
|
query string
|
||
|
|
}
|
||
|
|
func NewNotExistError(query string) *NotExistError {
|
||
|
|
return &NotExistError{ query: query }
|
||
|
|
}
|
||
|
|
func (err *NotExistError) Error() string {
|
||
|
|
return err.query
|
||
|
|
}
|
||
|
|
func IsNotExistError(err error) bool {
|
||
|
|
_, ok := err.(*NotExistError)
|
||
|
|
return ok
|
||
|
|
}
|
||
|
|
|