@@ -50,6 +50,7 @@ class OnboardException(Exception):
5050 "fail-connect" , # device is unreachable at IP:PORT
5151 "fail-execute" , # unable to execute device/API command
5252 "fail-login" , # bad username/password
53+ "fail-dns" , # failed to get IP address from name resolution
5354 "fail-general" , # other error
5455 )
5556
@@ -211,6 +212,11 @@ def check_ip(self):
211212 reassignment of the ot.ip_address was done.
212213 False if unable to find a device IP (error)
213214
215+ Raises:
216+ OnboardException("fail-general"):
217+ When a prefix was entered for an IP address
218+ OnboardException("fail-dns"):
219+ When a Name lookup via DNS fails to resolve an IP address
214220 """
215221 try :
216222 # Assign checked_ip to None for error handling
@@ -220,7 +226,7 @@ def check_ip(self):
220226 # Catch when someone has put in a prefix address, raise an exception
221227 except ValueError :
222228 raise OnboardException (
223- reason = "fail-prefix " , message = f"ERROR appears a prefix was entered: { self .ot .ip_address } "
229+ reason = "fail-general " , message = f"ERROR appears a prefix was entered: { self .ot .ip_address } "
224230 )
225231 # An AddrFormatError exception means that there is not an IP address in the field, and should continue on
226232 except AddrFormatError :
0 commit comments