logger handles exception
This commit is contained in:
@@ -16,8 +16,8 @@ class Vector(object):
|
||||
def dot(self, v):
|
||||
"""Returns the dot product with Vector *v*."""
|
||||
if not isinstance(v, self.__class__):
|
||||
logger.error(f"Expected an instance of {self.__class__}, but got {type(v)} instead.")
|
||||
return None
|
||||
msg = f"Expected an instance of {self.__class__}, but got {type(v)} instead."
|
||||
raise ValueError(msg)
|
||||
d = self.x * v.x + self.y * v.y + self.z * v.z
|
||||
return d
|
||||
|
||||
|
||||
Reference in New Issue
Block a user