pulumi/pkg/apitype/errors.go

18 lines
455 B
Go
Raw Normal View History

// 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)
}