优化error输出

This commit is contained in:
algotao
2026-01-11 17:24:11 +08:00
parent 5e102ea8e7
commit 369023b81d
45 changed files with 304 additions and 552 deletions

View File

@@ -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{