1
0
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:
Pete Davison
2023-09-19 13:21:40 -05:00
committed by GitHub
parent b1ff13d3e8
commit 078e213890
5 changed files with 38 additions and 3 deletions

View File

@@ -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
}