Skip to content

Instantly share code, notes, and snippets.

@dcb9
Created July 19, 2018 11:25
Show Gist options
  • Save dcb9/c4fef038a0c38c2d8b5dd08dcff3f83d to your computer and use it in GitHub Desktop.
Save dcb9/c4fef038a0c38c2d8b5dd08dcff3f83d to your computer and use it in GitHub Desktop.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: pkg/proxy/transport.go
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ transport.go:46 @ func (p *proxy) RoundTrip(httpReq *http.Request) (resp *http.Response, err error
return nil, err
}
var result *rpc.JSONRPCResult
result := rpc.NewJSONRPCResult()
if err = json.Unmarshal(body, &result); err != nil {
level.Error(p.logger).Log("err", err, "body", body)
return nil, err
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
modified: pkg/rpc/jsonrpc.go
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ jsonrpc.go:35 @ type JSONRPCError struct {
func (err *JSONRPCError) Error() string {
return fmt.Sprintf("[code: %d] %s", err.Code, err.Message)
}
func NewJSONRPCResult() *JSONRPCResult {
return &JSONRPCResult{
JSONRPC: "2.0",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment