| 998 | |
| 999 | @attr.s(eq=False, auto_attribs=True) |
| 1000 | class ExceptionChainRepr(ExceptionRepr): |
| 1001 | chain: Sequence[Tuple["ReprTraceback", Optional["ReprFileLocation"], Optional[str]]] |
| 1002 | |
| 1003 | def __attrs_post_init__(self) -> None: |
| 1004 | super().__attrs_post_init__() |
| 1005 | # reprcrash and reprtraceback of the outermost (the newest) exception |
| 1006 | # in the chain. |
| 1007 | self.reprtraceback = self.chain[-1][0] |
| 1008 | self.reprcrash = self.chain[-1][1] |
| 1009 | |
| 1010 | def toterminal(self, tw: TerminalWriter) -> None: |
| 1011 | for element in self.chain: |
| 1012 | element[0].toterminal(tw) |
| 1013 | if element[2] is not None: |
| 1014 | tw.line("") |
| 1015 | tw.line(element[2], yellow=True) |
| 1016 | super().toterminal(tw) |
| 1017 | |
| 1018 | |
| 1019 | @attr.s(eq=False, auto_attribs=True) |
no outgoing calls
no test coverage detected