Skip to content

Commit

Permalink
lowercase standard error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
powerman committed Dec 4, 2017
1 parent d10c0e9 commit 91cc933
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jsonrpc2/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/rpc"
)

var jErrRequest = json.RawMessage(`{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid request"}}`)
var jErrRequest = json.RawMessage(`{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}`)

// JSONRPC2 is an internal RPC service used to process batch requests.
type JSONRPC2 struct{}
Expand Down
12 changes: 6 additions & 6 deletions jsonrpc2/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

var (
// Actual returned error may have different message.
errParse = NewError(-32700, "Parse error")
errRequest = NewError(-32600, "Invalid request")
errMethod = NewError(-32601, "Method not found")
errParams = NewError(-32602, "Invalid params")
errInternal = NewError(-32603, "Internal error")
errServer = NewError(-32000, "Server error")
errParse = NewError(-32700, "parse error")
errRequest = NewError(-32600, "invalid request")
errMethod = NewError(-32601, "method not found")
errParams = NewError(-32602, "invalid params")
errInternal = NewError(-32603, "internal error")
errServer = NewError(-32000, "server error")
errServerError = NewError(-32001, "jsonrpc2.Error: json.Marshal failed")
)

Expand Down
4 changes: 2 additions & 2 deletions jsonrpc2/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func TestHTTPServer(t *testing.T) {
const jSum = `{"jsonrpc":"2.0","id":0,"method":"Svc.Sum","params":[3,5]}`
const jNotify = `{"jsonrpc":"2.0","method":"Svc.Sum","params":[3,5]}`
const jRes = `{"jsonrpc":"2.0","id":0,"result":8}`
const jErr = `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid request"}}`
const jParse = `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}}`
const jErr = `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}`
const jParse = `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"parse error"}}`
const contentType = "application/json"

cases := []struct {
Expand Down
4 changes: 2 additions & 2 deletions jsonrpc2/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func sortBatch(x interface{}) {
// Tests

const (
jerrParse = `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"Parse error"}}`
jerrRequest = `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Invalid request"}}`
jerrParse = `{"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"parse error"}}`
jerrRequest = `{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"invalid request"}}`
jerrMethodFmt = `{"jsonrpc":"2.0","id":0,"error":{"code":-32601,"message":"%s"}}`
jerrParamsFmt = `{"jsonrpc":"2.0","id":0,"error":{"code":-32602,"message":"%s"}}`
jres0 = `{"jsonrpc":"2.0","id":0,"result":0}`
Expand Down

0 comments on commit 91cc933

Please sign in to comment.