summaryrefslogtreecommitdiffstats
path: root/scripts/errorlist.py
blob: c4a0e7a0e567822c92a64bfebc932b5fb1c6fb1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3

from textwrap import indent

import borg.archiver  # noqa: F401 - need import to get Error and ErrorWithTraceback subclasses.
from borg.helpers import Error, ErrorWithTraceback

classes = Error.__subclasses__() + ErrorWithTraceback.__subclasses__()

for cls in sorted(classes, key=lambda cls: (cls.__module__, cls.__qualname__)):
    if cls is ErrorWithTraceback:
        continue
    print('   ', cls.__qualname__)
    print(indent(cls.__doc__, ' ' * 8))