1
0
mirror of https://github.com/go-task/task.git synced 2024-12-12 10:45:49 +02:00
task/errors.go
Andrey Nering 576b18246a Prefix all output messages from task with "task: "
This makes it easier to know if a message comes from task or from a command
stdout or stderr
2017-03-02 20:56:40 -03:00

34 lines
735 B
Go

package task
import (
"fmt"
)
// ErrNoTaskFile is returned when the program can not find a proper TaskFile
var ErrNoTaskFile = fmt.Errorf(`task: No task file found (is it named "%s"?)`, TaskFilePath)
type taskNotFoundError struct {
taskName string
}
func (err *taskNotFoundError) Error() string {
return fmt.Sprintf(`task: Task "%s" not found`, err.taskName)
}
type taskRunError struct {
taskName string
err error
}
func (err *taskRunError) Error() string {
return fmt.Sprintf(`task: Failed to run task "%s": %v`, err.taskName, err.err)
}
type cyclicDepError struct {
taskName string
}
func (err *cyclicDepError) Error() string {
return fmt.Sprintf(`task: Cyclic dependency of task "%s" detected`, err.taskName)
}