packer-cn/builder/hyperone/utils.go

17 lines
293 B
Go
Raw Normal View History

2019-01-23 08:04:05 -05:00
package hyperone
import (
"fmt"
"github.com/hyperonecom/h1-client-go"
)
func formatOpenAPIError(err error) string {
openAPIError, ok := err.(openapi.GenericOpenAPIError)
if !ok {
return err.Error()
}
return fmt.Sprintf("%s (body: %s)", openAPIError.Error(), openAPIError.Body())
}