chore: remove unecessary check in HandleExitCoder function and streamline logic (#1646)
* rm unecessary check and streamline logic Signed-off-by: zhaque44 <haque.zubair@gmail.com> * rm else and addressing PR comments Signed-off-by: zhaque44 <haque.zubair@gmail.com> --------- Signed-off-by: zhaque44 <haque.zubair@gmail.com>
This commit is contained in:
parent
522945707a
commit
8f44f12f07
|
|
@ -84,14 +84,13 @@ func HandleExitCoder(err error) {
|
|||
}
|
||||
|
||||
if exitErr, ok := err.(ExitCoder); ok {
|
||||
if err.Error() != "" {
|
||||
fmt.Fprintln(ErrWriter, err)
|
||||
if errMsg := err.Error(); errMsg != "" {
|
||||
fmt.Fprintln(ErrWriter, errMsg)
|
||||
}
|
||||
OsExiter(exitErr.ExitCode())
|
||||
return
|
||||
}
|
||||
// unknown error exit with code 3
|
||||
fmt.Fprintln(ErrWriter, err)
|
||||
|
||||
fmt.Fprintln(ErrWriter, err)
|
||||
OsExiter(3)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue