23 lines
608 B
Go
23 lines
608 B
Go
|
|
package repository
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/stores/mon"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Common repository errors
|
||
|
|
var (
|
||
|
|
// ErrNotFound is returned when a requested resource is not found
|
||
|
|
ErrNotFound = mon.ErrNotFound
|
||
|
|
|
||
|
|
// ErrInvalidObjectID is returned when an invalid MongoDB ObjectID is provided
|
||
|
|
ErrInvalidObjectID = fmt.Errorf("invalid objectId")
|
||
|
|
|
||
|
|
// ErrDuplicateKey is returned when attempting to insert a document with a duplicate key
|
||
|
|
ErrDuplicateKey = fmt.Errorf("duplicate key error")
|
||
|
|
|
||
|
|
// ErrInvalidInput is returned when input validation fails
|
||
|
|
ErrInvalidInput = fmt.Errorf("invalid input")
|
||
|
|
)
|