Improve logging, and catch exception if unable to connect to the RPC