1
0

refactor: errors

This commit is contained in:
dump_stack() 2024-02-20 11:37:19 +00:00
parent 4e92950929
commit 6036211172
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
6 changed files with 10 additions and 10 deletions

6
cache/cache.go vendored
View File

@ -55,10 +55,10 @@ func DownloadRootFS(path, file string) (err error) {
resp, err := grab.Get(tmp, fileurl)
if err != nil {
err = fmt.Errorf("Cannot download %s. It looks like you need "+
err = fmt.Errorf("cannot download %s. It looks like you need "+
"to generate it manually and place it "+
"to ~/.out-of-tree/images/. "+
"Check documentation for additional information.",
"to ~/.out-of-tree/images/; "+
"check documentation for additional information",
fileurl)
return
}

View File

@ -371,7 +371,7 @@ func openDatabase(path string) (db *sql.DB, err error) {
}
if version != currentDatabaseVersion {
err = fmt.Errorf("Database is not supported (%d instead of %d)",
err = fmt.Errorf("database is not supported (%d instead of %d)",
version, currentDatabaseVersion)
return
}

View File

@ -240,7 +240,7 @@ func firstSupported(kcfg config.KernelConfig, ka config.Artifact,
}
}
err = errors.New("No supported kernel found")
err = errors.New("no supported kernel found")
return
}

View File

@ -55,7 +55,7 @@ func (cmd *ImageEditCmd) Run(g *Globals) (err error) {
}
if len(kcfg.Kernels) == 0 {
return errors.New("No kernels found")
return errors.New("no kernels found")
}
ki := distro.KernelInfo{}

View File

@ -235,7 +235,7 @@ func (cmd *KernelListCmd) Run(g *Globals) (err error) {
}
if len(kcfg.Kernels) == 0 {
return errors.New("No kernels found")
return errors.New("no kernels found")
}
for _, k := range kcfg.Kernels {
@ -298,7 +298,7 @@ func (cmd *KernelAutogenCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error) {
for _, sk := range ka.Targets {
if sk.Distro.Release == "" {
err = errors.New("Please set distro_release")
err = errors.New("please set distro_release")
return
}

View File

@ -940,7 +940,7 @@ func (cmd PewCmd) performCI(ka config.Artifact) (err error) {
swg.Wait()
if !found {
err = errors.New("No supported kernels found")
err = errors.New("no supported kernels found")
}
return
@ -949,7 +949,7 @@ func (cmd PewCmd) performCI(ka config.Artifact) (err error) {
func kernelMask(kernel string) (km config.Target, err error) {
parts := strings.Split(kernel, ":")
if len(parts) != 2 {
err = errors.New("Kernel is not 'distroType:regex'")
err = errors.New("kernel is not 'distroType:regex'")
return
}