2018-08-30 20:54:42 +08:00
|
|
|
package hexonet
|
|
|
|
|
|
|
|
import (
|
Switch to Go 1.13 error wrapping (#604)
* Replaced errors.Wrap with fmt.Errorf (#589)
* Find: errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
Replace: fmt.Errorf($2: %w$3, $1)
* Replaced errors.Wrapf with fmt.Errorf (#589)
* Find: errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
Replace: fmt.Errorf($2: %w$3, $1)
* Find: errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)
* Replaced errors.Errorf with fmt.Errorf (#589)
* Find: errors\.Errorf
Replace: fmt.Errorf
* Cleaned up remaining imports
* Cleanup
* Regenerate provider support matrix
This was broken by #533 ... and it's now the third time this has been missed.
2020-01-29 00:06:56 +08:00
|
|
|
"fmt"
|
|
|
|
|
2020-02-28 02:04:17 +08:00
|
|
|
"github.com/hexonet/go-sdk/response"
|
2018-08-30 20:54:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// GetHXApiError returns an error including API error code and error description.
|
2020-02-28 02:04:17 +08:00
|
|
|
func (n *HXClient) GetHXApiError(format string, objectid string, r *response.Response) error {
|
|
|
|
return fmt.Errorf(format+" %s. [%s %s]", objectid, r.GetCode(), r.GetDescription())
|
2018-08-30 20:54:42 +08:00
|
|
|
}
|