q/src/errors/InvalidDirectory.go

18 lines
364 B
Go

package errors
import "fmt"
// InvalidDirectory errors are returned when the specified path is not a directory.
type InvalidDirectory struct {
Path string
}
// Error implements the text representation.
func (err *InvalidDirectory) Error() string {
if err.Path == "" {
return "Invalid directory"
}
return fmt.Sprintf("Invalid directory '%s'", err.Path)
}