-
Notifications
You must be signed in to change notification settings - Fork 21.5k
rpc: improve error codes for internal server errors #25678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
13c30d5
7be7894
051c61b
e094a2e
b1d8ffd
966cdf8
b6f147b
c1710f6
7de0069
07fbea0
bdf97a7
df08c42
b79f4cb
2834d92
6147d74
f6911af
80b4e2e
12e9e41
7c5ddc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,6 @@ import ( | |
| // if err := op.wait(...); err != nil { | ||
| // h.removeRequestOp(op) // timeout, etc. | ||
| // } | ||
| // | ||
| type handler struct { | ||
| reg *serviceRegistry | ||
| unsubscribeCb *callback | ||
|
|
@@ -354,7 +353,7 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage | |
| // handleSubscribe processes *_subscribe method calls. | ||
| func (h *handler) handleSubscribe(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage { | ||
| if !h.allowSubscribe { | ||
| return msg.errorResponse(ErrNotificationsUnsupported) | ||
| return msg.errorResponse(&internalServerError{cause: ErrNotificationsUnsupported}) | ||
| } | ||
|
|
||
| // Subscription method name is first argument. | ||
|
|
@@ -388,7 +387,7 @@ func (h *handler) handleSubscribe(cp *callProc, msg *jsonrpcMessage) *jsonrpcMes | |
| func (h *handler) runMethod(ctx context.Context, msg *jsonrpcMessage, callb *callback, args []reflect.Value) *jsonrpcMessage { | ||
| result, err := callb.call(ctx, msg.Method, args) | ||
| if err != nil { | ||
| return msg.errorResponse(err) | ||
| return msg.errorResponse(&internalServerError{cause: err}) | ||
|
||
| } | ||
| return msg.response(result) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.