mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 23:28:39 +03:00
move Filesystem config validation to vfs
This commit is contained in:
committed by
Nicola Murino
parent
f2f612b450
commit
f19937b715
20
utils/errors.go
Normal file
20
utils/errors.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package utils
|
||||
|
||||
import "fmt"
|
||||
|
||||
// ValidationError raised if input data is not valid
|
||||
type ValidationError struct {
|
||||
err string
|
||||
}
|
||||
|
||||
// Validation error details
|
||||
func (e *ValidationError) Error() string {
|
||||
return fmt.Sprintf("Validation error: %s", e.err)
|
||||
}
|
||||
|
||||
// NewValidationError returns a validation errors
|
||||
func NewValidationError(error string) *ValidationError {
|
||||
return &ValidationError{
|
||||
err: error,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user