Add try-catch level for invalidmac exception

This commit is contained in:
tke
2022-02-08 17:43:15 +01:00
parent a04caf4f28
commit e8dc903111

View File

@@ -63,9 +63,10 @@ def sym_time(val):
def vendor(mac): def vendor(mac):
try: try:
from mac_vendor_lookup import InvalidMacError, MacLookup as mlu from mac_vendor_lookup import InvalidMacError, MacLookup as mlu
return mlu().lookup(mac.strip()) try:
except InvalidMacError: return mlu().lookup(mac.strip())
return f"not a MAC {str(mac).strip()} of type {type(mac)}" except InvalidMacError:
return f"not a MAC {str(mac).strip()} of type {type(mac)}"
except ModuleNotFoundError: except ModuleNotFoundError:
return "module not available" return "module not available"