Skip to content

Commit

Permalink
Merge pull request #72 from darrenstahlmsft/ContainerError
Browse files Browse the repository at this point in the history
Stop saying all container errors occured in win32
  • Loading branch information
darstahl authored Sep 23, 2016
2 parents 2f54289 + 89caa88 commit ab64fb8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ func (e *ContainerError) Error() string {
s += " encountered an error during " + e.Operation
}

if e.Err != nil {
s += fmt.Sprintf(" failed in Win32: %s (0x%x)", e.Err, win32FromError(e.Err))
switch e.Err.(type) {
case nil:
break
case syscall.Errno:
s += fmt.Sprintf(": failure in a Windows system call: %s (0x%x)", e.Err, win32FromError(e.Err))
default:
s += fmt.Sprintf(": %s", e.Err.Error())
}

if e.ExtraInfo != "" {
Expand Down Expand Up @@ -119,16 +124,16 @@ func (e *ProcessError) Error() string {
}

if e.Operation != "" {
s += " " + e.Operation
s += " encountered an error during " + e.Operation
}

switch e.Err.(type) {
case nil:
break
case syscall.Errno:
s += fmt.Sprintf(" failed in Win32: %s (0x%x)", e.Err, win32FromError(e.Err))
s += fmt.Sprintf(": failure in a Windows system call: %s (0x%x)", e.Err, win32FromError(e.Err))
default:
s += fmt.Sprintf(" failed: %s", e.Err.Error())
s += fmt.Sprintf(": %s", e.Err.Error())
}

return s
Expand Down

0 comments on commit ab64fb8

Please sign in to comment.