Doc(Compute/typing): Make ComputeError and TypingError more clear
This commit is contained in:
parent
d2f67a0961
commit
9d5b441402
@ -50,12 +50,12 @@ def compute(node, left_v, right_v):
|
|||||||
>>> compute("~", MOnumber(1), MOnumber(2))
|
>>> compute("~", MOnumber(1), MOnumber(2))
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
mapytex.calculus.core.compute.exceptions.ComputeError: Unknown operation (~)
|
mapytex.calculus.core.compute.exceptions.ComputeError: Unknown operation (~) in compute
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
operation = OPERATIONS[node]
|
operation = OPERATIONS[node]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ComputeError(f"Unknown operation ({node})")
|
raise ComputeError(f"Unknown operation ({node}) in compute")
|
||||||
|
|
||||||
return operation(left_v, right_v)
|
return operation(left_v, right_v)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ def typing(node, left_v, right_v):
|
|||||||
try:
|
try:
|
||||||
operation = OPERATIONS[node]
|
operation = OPERATIONS[node]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise TypingError(f"Unknown operation ({node})")
|
raise TypingError(f"Unknown operation ({node}) in typing")
|
||||||
return operation(left_v, right_v)
|
return operation(left_v, right_v)
|
||||||
|
|
||||||
def typing_capacities(node):
|
def typing_capacities(node):
|
||||||
|
Loading…
Reference in New Issue
Block a user