Skip to content

Commit

Permalink
Print strack trace only if recover is not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
mblaschke committed Nov 1, 2017
1 parent ae1bf37 commit 455c8c4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sync/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ func RsyncPath(name string) string {
}

func ShellErrorHandler(recover interface{}) {
process, ok := recover.(*shell.Process)
if ok {
if process, ok := recover.(*shell.Process); ok {
p := process.ExitStatus
p = 2
if p != 0 {
Expand All @@ -82,7 +81,7 @@ func ShellErrorHandler(recover interface{}) {

os.Exit(2)
}
} else {
} else if recover != nil {
fmt.Print("ERROR:")
fmt.Println(recover)
debug.PrintStack()
Expand Down

0 comments on commit 455c8c4

Please sign in to comment.