mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
* Implemented multi-error handling in MultiError() class * Added newsfragement file and test * updated doc-string and list-struct * updating docstring
14 lines
432 B
Python
14 lines
432 B
Python
from libp2p.exceptions import (
|
|
MultiError,
|
|
)
|
|
|
|
|
|
def test_multierror_str_and_storage():
|
|
errors = [ValueError("bad value"), KeyError("missing key"), "custom error"]
|
|
multi_error = MultiError(errors)
|
|
# Check for storage
|
|
assert multi_error.errors == errors
|
|
# Check for representation
|
|
expected = "Error 1: bad value\n" "Error 2: 'missing key'\n" "Error 3: custom error"
|
|
assert str(multi_error) == expected
|