Added err detail

This commit is contained in:
zhenorzz 2023-09-04 15:03:45 +08:00
parent c0c9eb105d
commit 2d5fec2013
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ func (git *GIT) Run(operator string, options ...string) error {
cmd.Stdout = &git.Output
cmd.Stderr = &git.Err
if err := cmd.Run(); err != nil {
return fmt.Errorf("error: %s, detail: %s", err, git.Err.String())
return fmt.Errorf("error: %s, detail: %s, command: %s, paste it to command-line to check if it is correct", err, git.Err.String(), cmd.String())
}
return nil
}

View File

@ -6,6 +6,7 @@ package pkg
import (
"bytes"
"fmt"
"os/exec"
)
@ -25,7 +26,7 @@ func (svn *SVN) Run(operator string, options ...string) error {
cmd.Stdout = &svn.Output
cmd.Stderr = &svn.Err
if err := cmd.Run(); err != nil {
return err
return fmt.Errorf("error: %s, detail: %s, command: %s, paste it to command-line to check if it is correct", err, svn.Err.String(), cmd.String())
}
return nil
}