Add try-catch level for invalidmac exception
This commit is contained in:
@@ -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"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user