feat: enhanced error messages for cloud and oss specific commands (#347)

* feat: enhanced error messages for cloud and oss specific commands

* chore: rename test
This commit is contained in:
William Baker
2021-12-28 10:03:29 -05:00
committed by GitHub
parent 13d0827815
commit 7af0b2ae73
36 changed files with 1503 additions and 1985 deletions

View File

@ -578,16 +578,22 @@ func strlen(s string) int {
}
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
// It also provides additional information about the HTTP response specific for the influx-cli.
type GenericOpenAPIError struct {
body []byte
error string
model ApiError
body []byte
error string
model ApiError
buildHeader string
}
func (e GenericOpenAPIError) Body() []byte {
return e.body
}
func (e GenericOpenAPIError) BuildHeader() string {
return e.buildHeader
}
// Error returns non-empty string if there was an error.
func (e GenericOpenAPIError) Error() string {
if e.model != nil {