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,6 +63,7 @@ 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
try:
return mlu().lookup(mac.strip()) return mlu().lookup(mac.strip())
except InvalidMacError: except InvalidMacError:
return f"not a MAC {str(mac).strip()} of type {type(mac)}" return f"not a MAC {str(mac).strip()} of type {type(mac)}"