github.com/tooploox/oya@v0.0.21-0.20230524103240-1cda1861aad6/pkg/project/errors.go (about)

     1  package project
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/tooploox/oya/pkg/task"
     7  )
     8  
     9  type ErrNoOyafile struct {
    10  	Path string
    11  }
    12  
    13  func (e ErrNoOyafile) Error() string {
    14  	return fmt.Sprintf("no Oyafile in %v", e.Path)
    15  }
    16  
    17  type ErrNoOyafiles struct {
    18  	Path string
    19  }
    20  
    21  func (e ErrNoOyafiles) Error() string {
    22  	return fmt.Sprintf("no Oyafile in %v", e.Path)
    23  }
    24  
    25  type ErrNoProject struct {
    26  	Path string
    27  }
    28  
    29  func (e ErrNoProject) Error() string {
    30  	return fmt.Sprintf("no Oyafile project in %v or any parent directories", e.Path)
    31  }
    32  
    33  type ErrNoTask struct {
    34  	Task task.Name
    35  }
    36  
    37  func (e ErrNoTask) Error() string {
    38  	return fmt.Sprintf("missing task %q", e.Task)
    39  }
    40  
    41  type ErrInstallingPacks struct {
    42  	Cause          error
    43  	ProjectRootDir string
    44  }
    45  
    46  func (e ErrInstallingPacks) Error() string {
    47  	return fmt.Sprintf("error installing requirements for project at %v: %v", e.ProjectRootDir, e.Cause.Error())
    48  }