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):
try:
from mac_vendor_lookup import InvalidMacError, MacLookup as mlu
return mlu().lookup(mac.strip())
except InvalidMacError:
return f"not a MAC {str(mac).strip()} of type {type(mac)}"
try:
return mlu().lookup(mac.strip())
except InvalidMacError:
return f"not a MAC {str(mac).strip()} of type {type(mac)}"
except ModuleNotFoundError:
return "module not available"