-
Notifications
You must be signed in to change notification settings - Fork 205
[ws-server] Batch support #300
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 7 commits
40ac215
b75ea9d
3364114
62692a9
5b84959
0672349
0634383
ba95302
ac97e8b
8f4261a
ccf5701
58defdc
63381d6
7bf563e
df9c395
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 |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ impl RpcModule { | |
| pub fn register_method<F, R>(&mut self, method_name: &'static str, callback: F) -> Result<(), Error> | ||
| where | ||
| R: Serialize, | ||
| F: RpcMethod<R, InvalidParams>, | ||
| F: RpcMethod<R, CallError>, | ||
| { | ||
| self.verify_method_name(method_name)?; | ||
|
|
||
|
|
@@ -47,7 +47,15 @@ impl RpcModule { | |
| Box::new(move |id, params, tx, _| { | ||
| match callback(params) { | ||
| Ok(res) => send_response(id, tx, res), | ||
| Err(InvalidParams) => send_error(id, tx, JsonRpcErrorCode::InvalidParams.into()), | ||
| // TODO: this looks wonky... | ||
| Err(CallError::InvalidParams(InvalidParams)) => { | ||
|
||
| send_error(id, tx, JsonRpcErrorCode::InvalidParams.into()) | ||
| } | ||
| Err(CallError::Failed(e)) => { | ||
niklasad1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // TODO: do something smart(-er) with the error? | ||
| log::error!("Call failed with: {}", e); | ||
| send_error(id, tx, JsonRpcErrorCode::ServerError(CALL_EXECUTION_FAILED_CODE).into()) | ||
| } | ||
| }; | ||
|
|
||
| Ok(()) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.