You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-1-e472ddea34ee> in <module>
9 d = divide(2, 0)
10
---> 11 d.unwrap()
pycats/pycats/data/result.py in unwrap(self)
163 def unwrap(self):
164 if isinstance(self.value, Exception):
--> 165 raise self.value
166 return self.value
pycats/pycats/data/result.py in wrapped_func(*args, **kwargs)
110 def wrapped_func(*args, **kwargs):
111 try:
--> 112 return Ok(func(*args, **kwargs))
113 except Exception as e:
114 return Err(e)
<ipython-input-1-e472ddea34ee> in divide(a, b)
4 @Result.wrap
5 def divide(a, b):
----> 6 return a / b
7
8
ZeroDivisionError: division by zero
It would be helpful if the traceback included the line which actually called the wrapped function:
d=divide(2, 0)
instead of skipping from the .unwrap() call straight to inside the wrapped function. In a long chain of operations, it could be difficult to debug which operation was causing the exception.
The text was updated successfully, but these errors were encountered:
Example:
Will give a traceback like:
It would be helpful if the traceback included the line which actually called the wrapped function:
instead of skipping from the
.unwrap()
call straight to inside the wrapped function. In a long chain of operations, it could be difficult to debug which operation was causing the exception.The text was updated successfully, but these errors were encountered: