mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-23 00:03:36 +00:00
Basic stuff, loadOne
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package errors
|
||||
|
||||
import "fmt"
|
||||
|
||||
// InternalError error
|
||||
type InternalError string
|
||||
|
||||
// Error message
|
||||
func (ie InternalError) Error() string {
|
||||
return fmt.Sprintf("internal error, %s", string(ie))
|
||||
}
|
||||
|
||||
// InternalErrorf function creates an instance of InternalError
|
||||
func InternalErrorf(format string, params ...interface{}) error {
|
||||
return InternalError(fmt.Sprintf(format, params...))
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package errors
|
||||
|
||||
import "fmt"
|
||||
|
||||
// NotFound error
|
||||
type NotFound string
|
||||
|
||||
// Error message
|
||||
func (nf NotFound) Error() string {
|
||||
return fmt.Sprintf("can not find, %s", string(nf))
|
||||
}
|
||||
|
||||
// NotFoundErrorf function creates an instance of BadRequestError
|
||||
func NotFoundErrorf(format string, params ...interface{}) error {
|
||||
return NotFound(fmt.Sprintf(format, params...))
|
||||
}
|
||||
Reference in New Issue
Block a user