Component evidence

Taskfile Error Handling Definitions (errors/errors_taskfile.go)

task · errors/errors_taskfile.go · go · MIT
dev-toolsclilang:gotag:tasktag:errorstag:validation

Defines custom error types for Taskfile operations, including missing files, invalid formats, and security issues. Use this when building tools that interact with Taskfiles to provide consistent error reporting.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/go-task/task | License: MIT | Copyright 2016 Andrey Nering
// Provided via justclaw.it.com; keep this notice with the code.
package errors

import (
	"fmt"
	"net/http"
	"path/filepath"
	"time"

	"github.com/Masterminds/semver/v3"
)

// TaskfileNotFoundError is returned when no appropriate Taskfile is found when
// searching the filesystem.
type TaskfileNotFoundError struct {
	URI         string
	Walk        bool
	AskInit     bool
	OwnerChange bool
}

func (err TaskfileNotFoundError) Error() string {
	var walkText string
	if err.OwnerChange {
		walkText = " (or any of the parent directories until ownership changed)."
	} else if err.Walk {
		walkText = " (or any of the parent directories)."
	}
	if err.AskInit {
		walkText += " Run `task --init` to create a new T

... (truncated -- full source via MCP)