diff options
author | Unknwon <u@gogs.io> | 2019-10-26 01:48:19 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2019-10-26 01:48:19 -0700 |
commit | 1cfdd1283a91c628b883bdae75e48619db7175e1 (patch) | |
tree | 561bf8613edc5cbb95d40fc92b65db4003bab5bf /internal | |
parent | 762e1167c71b34cbb91fcffb94bc2bd9844dab81 (diff) |
cmd/import: improve error message
- Print app.Run() error
Diffstat (limited to 'internal')
-rw-r--r-- | internal/cmd/import.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/cmd/import.go b/internal/cmd/import.go index 4ee43b5b..b274d1dd 100644 --- a/internal/cmd/import.go +++ b/internal/cmd/import.go @@ -7,6 +7,7 @@ package cmd import ( "bufio" "bytes" + "errors" "fmt" "os" "path/filepath" @@ -43,14 +44,14 @@ without manually hacking the data files`, func runImportLocale(c *cli.Context) error { if !c.IsSet("source") { - return fmt.Errorf("Source directory is not specified") + return errors.New("source directory is not specified") } else if !c.IsSet("target") { - return fmt.Errorf("Target directory is not specified") + return errors.New("target directory is not specified") } if !com.IsDir(c.String("source")) { - return fmt.Errorf("Source directory does not exist or is not a directory") + return fmt.Errorf("source directory %q does not exist or is not a directory", c.String("source")) } else if !com.IsDir(c.String("target")) { - return fmt.Errorf("Target directory does not exist or is not a directory") + return fmt.Errorf("target directory %q does not exist or is not a directory", c.String("target")) } if c.IsSet("config") { |