mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-21 20:36:03 +03:00
add mock in tests
This commit is contained in:
parent
a0f74fcad8
commit
b5d420b68e
@ -19,8 +19,8 @@ func (f *Failure) ApiError() string {
|
||||
func (f *Failure) ApiErrors() []string {
|
||||
var errors []string
|
||||
|
||||
for i := 0; i < len(f.ApiErrs); i++ {
|
||||
errors = append(errors, fmt.Sprintf("%v", f.ApiErrs[i]))
|
||||
for k, i := range f.ApiErrs {
|
||||
errors = append(errors, fmt.Sprintf("%v: %v", k, i))
|
||||
}
|
||||
|
||||
return errors
|
||||
|
@ -4,11 +4,11 @@ package errs
|
||||
type Failure struct {
|
||||
RuntimeErr error
|
||||
ApiErr string
|
||||
ApiErrs []string
|
||||
ApiErrs map[string]string
|
||||
}
|
||||
|
||||
// FailureResponse convert json error response into object
|
||||
type FailureResponse struct {
|
||||
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||
Errors []string `json:"errors,omitempty"`
|
||||
Errors map[string]string `json:"errors,omitempty"`
|
||||
}
|
||||
|
3524
v5/client_test.go
3524
v5/client_test.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user