mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
feat: error handling for undefined schema version (#1342)
* feat: error handling for undefined schema version * docs: error codes * chore: changelog
This commit is contained in:
@@ -120,3 +120,20 @@ func (err *TaskfileCacheNotFound) Error() string {
|
||||
func (err *TaskfileCacheNotFound) Code() int {
|
||||
return CodeTaskfileCacheNotFound
|
||||
}
|
||||
|
||||
// TaskfileVersionNotDefined is returned when the user attempts to run a
|
||||
// Taskfile that does not contain a Taskfile schema version key.
|
||||
type TaskfileVersionNotDefined struct {
|
||||
URI string
|
||||
}
|
||||
|
||||
func (err *TaskfileVersionNotDefined) Error() string {
|
||||
return fmt.Sprintf(
|
||||
`task: Taskfile %q does not contain a schema version key`,
|
||||
err.URI,
|
||||
)
|
||||
}
|
||||
|
||||
func (err *TaskfileVersionNotDefined) Code() int {
|
||||
return CodeTaskfileVersionNotDefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user