Unwrap multiple errors
This commit is contained in:
parent
3b101279ef
commit
0a59189d27
1 changed files with 6 additions and 1 deletions
|
|
@ -357,7 +357,12 @@ func runRoot(cmd *cobra.Command, args []string) {
|
|||
if err != nil {
|
||||
// improve error message
|
||||
err = wrapFatalError(err)
|
||||
valueChan <- util.Param{Key: keys.Fatal, Val: err}
|
||||
|
||||
if uw, ok := err.(interface{ Unwrap() []error }); ok {
|
||||
valueChan <- util.Param{Key: keys.Fatal, Val: uw.Unwrap()}
|
||||
} else {
|
||||
valueChan <- util.Param{Key: keys.Fatal, Val: err}
|
||||
}
|
||||
|
||||
// TODO stop reboot loop if user updates config (or show countdown in UI)
|
||||
log.FATAL.Println(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue