From 8cc751d1cc2487aeeeb3cf57721bbfeb726f7ba4 Mon Sep 17 00:00:00 2001 From: Stephen Akridge Date: Thu, 29 Nov 2018 10:51:07 -0800 Subject: [PATCH] Improve RPC service startup error messages with actual error Error always fixed to message about ports but that's not the only error that can occur. --- src/rpc.rs | 4 ++-- src/rpc_pubsub.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index 3f02b07c17..d9557d2a21 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -59,8 +59,8 @@ impl JsonRpcService { AccessControlAllowOrigin::Any, ])) .start_http(&rpc_addr); - if server.is_err() { - warn!("JSON RPC service unavailable: unable to bind to RPC port {}. \nMake sure this port is not already in use by another application", rpc_addr.port()); + if let Err(e) = server { + warn!("JSON RPC service unavailable error: {:?}. \nAlso, check that port {} is not already in use by another application", e, rpc_addr.port()); return; } while !exit_.load(Ordering::Relaxed) { diff --git a/src/rpc_pubsub.rs b/src/rpc_pubsub.rs index 9541aeb84d..1f531c2b23 100644 --- a/src/rpc_pubsub.rs +++ b/src/rpc_pubsub.rs @@ -59,8 +59,8 @@ impl PubSubService { }) .start(&pubsub_addr); - if server.is_err() { - warn!("Pubsub service unavailable: unable to bind to port {}. \nMake sure this port is not already in use by another application", pubsub_addr.port()); + if let Err(e) = server { + warn!("Pubsub service unavailable error: {:?}. \nAlso, check that port {} is not already in use by another application", e, pubsub_addr.port()); return; } while !exit_.load(Ordering::Relaxed) {