2018-03-21 20:43:21 +01:00
|
|
|
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
2018-01-11 00:04:55 +01:00
|
|
|
|
|
|
|
package apitype
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// ErrorResponse is returned from the API when an actual response body is not appropriate. i.e.
|
|
|
|
// in all error situations.
|
|
|
|
type ErrorResponse struct {
|
|
|
|
Code int `json:"code"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error implements the Error interface.
|
|
|
|
func (err ErrorResponse) Error() string {
|
|
|
|
return fmt.Sprintf("[%d] %s", err.Code, err.Message)
|
|
|
|
}
|