// Package utils provides shared utilities for the fetch_ml project. package errors import ( "fmt" ) // DataFetchError represents an error that occurred while fetching a dataset // from the NAS to the ML server. type DataFetchError struct { Dataset string JobName string Err error } func (e *DataFetchError) Error() string { return fmt.Sprintf("failed to fetch dataset %s for job %s: %v", e.Dataset, e.JobName, e.Err) } func (e *DataFetchError) Unwrap() error { return e.Err } type TaskExecutionError struct { TaskID string JobName string Phase string // "data_fetch", "execution", "cleanup" Err error } func (e *TaskExecutionError) Error() string { return fmt.Sprintf("task %s (%s) failed during %s: %v", e.TaskID[:8], e.JobName, e.Phase, e.Err) } func (e *TaskExecutionError) Unwrap() error { return e.Err }