repogen/internal/mongo/errors.go

21 lines
512 B
Go
Raw Normal View History

2021-01-26 13:23:52 +00:00
package mongo
// GenerationError is an error from generating MongoDB repository
type GenerationError string
func (err GenerationError) Error() string {
switch err {
case OperationNotSupportedError:
return "operation not supported"
case BsonTagNotFoundError:
return "bson tag not found"
}
return string(err)
}
// generation error constants
const (
OperationNotSupportedError GenerationError = "ERROR_OPERATION_NOT_SUPPORTED"
BsonTagNotFoundError GenerationError = "ERROR_BSON_TAG_NOT_FOUND"
)