Skip to content

Commit

Permalink
feat: unmarshall error data as byte (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchen-cb authored Feb 24, 2025
1 parent f4a421f commit 62611a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions proxyd/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func (r *RPCRes) MarshalJSON() ([]byte, error) {
}

type RPCErr struct {
Code int `json:"code"`
Message string `json:"message"`
Data string `json:"data,omitempty"`
HTTPErrorCode int `json:"-"`
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data,omitempty"`
HTTPErrorCode int `json:"-"`
}

func (r *RPCErr) Error() string {
Expand Down
2 changes: 1 addition & 1 deletion proxyd/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestRPCResJSON(t *testing.T) {
Error: &RPCErr{
Code: 1234,
Message: "test err",
Data: "revert",
Data: []byte(`"revert"`),
},
ID: []byte("123"),
},
Expand Down

0 comments on commit 62611a0

Please sign in to comment.