mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 12:19:53 +01:00
* Clean up TE error handling, wrap sigalrm handler * Preserve error detail on AnsibleAction and Connection exceptions. * Remove multiple layers of unreachable or redundant error handling. * Wrap manual alarm signal/timeout handling into a context manager, add tests. Co-authored-by: Matt Clay <matt@mystile.com> * update error message check in test * update test timeout message assertions --------- Co-authored-by: Matt Clay <matt@mystile.com>
18 lines
462 B
Python
18 lines
462 B
Python
from __future__ import annotations
|
|
|
|
import collections.abc as c
|
|
|
|
|
|
def raise_exceptions(exceptions: c.Sequence[BaseException]) -> None:
|
|
"""
|
|
Raise a chain of exceptions from the given exception list.
|
|
Exceptions will be raised starting from the end of the list.
|
|
"""
|
|
if len(exceptions) > 1:
|
|
try:
|
|
raise_exceptions(exceptions[1:])
|
|
except Exception as ex:
|
|
raise exceptions[0] from ex
|
|
|
|
raise exceptions[0]
|