diff options
author | Azul <azul@riseup.net> | 2016-09-16 14:32:55 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-09-16 14:33:01 +0200 |
commit | 964cd0b049e67ca10bd37b67c4b14ccd37064511 (patch) | |
tree | 67ea319566dbef5715ccb7a52e0a44f5a6412dbe /lib | |
parent | e2aedcaade71dfe9103fdc8e705f59ece5f3a4d0 (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/nickserver/nicknym/source.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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) |