diff options
Diffstat (limited to 'vm/vmimpl/vmimpl.go')
| -rw-r--r-- | vm/vmimpl/vmimpl.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go index 9dbd61a92..0a4ada028 100644 --- a/vm/vmimpl/vmimpl.go +++ b/vm/vmimpl/vmimpl.go @@ -93,12 +93,11 @@ type BootError struct { } func MakeBootError(err error, output []byte) error { - switch err1 := err.(type) { - case *osutil.VerboseError: - return BootError{err1.Title, append(err1.Output, output...)} - default: - return BootError{err.Error(), output} + var verboseError *osutil.VerboseError + if errors.As(err, &verboseError) { + return BootError{verboseError.Title, append(verboseError.Output, output...)} } + return BootError{err.Error(), output} } func (err BootError) Error() string { |
