refactor: errors
This commit is contained in:
parent
4e92950929
commit
6036211172
6
cache/cache.go
vendored
6
cache/cache.go
vendored
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user