优化error输出
This commit is contained in:
@@ -38,8 +38,7 @@ func RunConvert(args ...string) error {
|
||||
destPath := paramDestPath(fs)
|
||||
|
||||
if err := fs.Parse(args); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "command line parse error", "err", err)
|
||||
return err
|
||||
return fmt.Errorf("Command line parse error: %w", err)
|
||||
}
|
||||
|
||||
if fs.NArg() > 0 || *mapCfgFile == "" || len(*sourcePath) == 0 || len(*destPath) == 0 {
|
||||
@@ -49,8 +48,7 @@ func RunConvert(args ...string) error {
|
||||
|
||||
mapCfg, err := LoadMapFile(*mapCfgFile)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "LoadConfigFile error", "err", err)
|
||||
return err
|
||||
return fmt.Errorf("LoadMapFile error: %w", err)
|
||||
}
|
||||
|
||||
convertParams := convertParams{
|
||||
|
||||
Reference in New Issue
Block a user