diff --git a/mongox/errors/malformed.go b/mongox/errors/malformed.go new file mode 100644 index 0000000..113a8a3 --- /dev/null +++ b/mongox/errors/malformed.go @@ -0,0 +1,16 @@ +package errors + +import "fmt" + +// Malformed error +type Malformed string + +// Error message +func (m Malformed) Error() string { + return fmt.Sprintf("Malformed, %s", string(m)) +} + +// Malformedf creates an instance of Malformed +func Malformedf(format string, params ...interface{}) error { + return Malformed(fmt.Sprintf(format, params...)) +}