[mod] misc, better error message

I'm using repr to be able to detect if it's a string or a number since it's an error I'm expecting
This commit is contained in:
Bram 2018-09-01 02:50:22 +02:00 committed by Alexandre Aubin
parent 85930163a0
commit ded4895b7e

View file

@ -45,7 +45,7 @@ class IPDiagnoser(Diagnoser):
elif protocol == 6:
url = 'https://ip6.yunohost.org'
else:
raise ValueError("invalid protocol version")
raise ValueError("invalid protocol version, it should be either 4 or 6 and was '%s'" % repr(protocol))
try:
return download_text(url, timeout=30).strip()