From 964cd0b049e67ca10bd37b67c4b14ccd37064511 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 16 Sep 2016 14:32:55 +0200 Subject: deal with network issues in nicknym source This is a first step. In case the suspected nicknym server cannot be reached we will now move on and try other sources. It's robably not what we want in the long run. In order to know wether no key exists or we just failed to connect to some servers a different http response code would be nice if network errors occured. This simplifies testing such scenarios in the unit test and makes the remote tests skip on network failure. --- lib/nickserver/nicknym/source.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/nickserver/nicknym/source.rb b/lib/nickserver/nicknym/source.rb index 45daeaf..0638869 100644 --- a/lib/nickserver/nicknym/source.rb +++ b/lib/nickserver/nicknym/source.rb @@ -8,6 +8,8 @@ module Nickserver def available_for?(domain) status, body = adapter.get "https://#{domain}/provider.json" status == 200 && provider_with_mx?(body) + rescue HTTP::ConnectionError + return false end def query(email) -- cgit v1.2.3