diff --git a/src/electrum/server.rs b/src/electrum/server.rs index 6157fbef4..fccccf13b 100644 --- a/src/electrum/server.rs +++ b/src/electrum/server.rs @@ -389,6 +389,10 @@ impl Connection { "merkle" : merkle})) } + fn unknown_method(&self, method: &str) -> Result { + Ok(json!(format!("unknown method {}", method))) + } + fn handle_command(&mut self, method: &str, params: &[Value], id: &Value) -> Result { let timer = self .stats @@ -424,7 +428,7 @@ impl Connection { #[cfg(feature = "electrum-discovery")] "server.add_peer" => self.server_add_peer(¶ms), - &_ => bail!("unknown method {} {:?}", method, params), + &_ => self.unknown_method(&method), }; timer.observe_duration(); // TODO: return application errors should be sent to the client