Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
update response payload structure
Browse files Browse the repository at this point in the history
  • Loading branch information
idoqo committed Mar 17, 2022
1 parent bb4555e commit 383742f
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 23 deletions.
4 changes: 2 additions & 2 deletions commands/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ type Error struct {
func GetError(err ErrorResponse) Error {
v := reflect.ValueOf(err)
p := v.Elem().FieldByName("Payload")
e := p.Elem().FieldByName("Error")
m := p.Elem().FieldByName("Message")
return Error{
Code: err.Code(),
Error: e.String(),
Error: m.String(),
}
}

Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ require (
github.com/AlekSi/pointer v1.1.0
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
github.com/go-openapi/runtime v0.19.20
github.com/percona/pmm v0.0.0-20211227150642-d5b782829da7
github.com/percona/pmm v0.0.0-20220314044734-70e6ebbedd4f
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.1
golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20210510120138-977fb7262007
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

Expand All @@ -37,8 +37,8 @@ require (
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.7.1 // indirect
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/text v0.3.5 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)
Loading

0 comments on commit 383742f

Please sign in to comment.