Skip to content

Commit

Permalink
Don't embed Error into Response
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSLevy committed Jan 2, 2019
1 parent fc2ce38 commit 78b52d9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"io/ioutil"
"net/http"

jrpc "github.com/AdamSLevy/jsonrpc2/v9"
jrpc "github.com/AdamSLevy/jsonrpc2/v10"
)

var endpoint = "http://localhost:18888"
Expand Down
2 changes: 1 addition & 1 deletion examplefuncs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"io/ioutil"
"net/http"

"github.com/AdamSLevy/jsonrpc2/v9"
"github.com/AdamSLevy/jsonrpc2/v10"
)

// Use the http and json packages to send a Request object.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/AdamSLevy/jsonrpc2/v9
module github.com/AdamSLevy/jsonrpc2/v10

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func processRequest(methods MethodMap, rawReq json.RawMessage) Response {

// Log the method name if debugging is enabled and the method had an
// InternalError.
if DebugMethodFunc && res.Error != nil && res.Code == InternalErrorCode {
if DebugMethodFunc && res.Error != nil && res.Error.Code == InternalErrorCode {
logger.Printf("Method: %#v\n\n", *req.Method)
}

Expand Down
2 changes: 1 addition & 1 deletion response.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Version = "2.0"
type Response struct {
JSONRPC string `json:"jsonrpc"`
Result interface{} `json:"result,omitempty"`
*Error `json:"error,omitempty"`
Error *Error `json:"error,omitempty"`
ID interface{} `json:"id"`
}

Expand Down

0 comments on commit 78b52d9

Please sign in to comment.