diff options
Diffstat (limited to 'main.py')
| -rwxr-xr-x | main.py | 23 |
1 files changed, 14 insertions, 9 deletions
| @@ -57,6 +57,7 @@ from error import RepoChangedException | |||
| 57 | from error import RepoExitError | 57 | from error import RepoExitError |
| 58 | from error import RepoUnhandledExceptionError | 58 | from error import RepoUnhandledExceptionError |
| 59 | from error import RepoError | 59 | from error import RepoError |
| 60 | from error import SilentRepoExitError | ||
| 60 | import gitc_utils | 61 | import gitc_utils |
| 61 | from manifest_xml import GitcClient, RepoClient | 62 | from manifest_xml import GitcClient, RepoClient |
| 62 | from pager import RunPager, TerminatePager | 63 | from pager import RunPager, TerminatePager |
| @@ -872,16 +873,20 @@ def _Main(argv): | |||
| 872 | 873 | ||
| 873 | result = repo._Run(name, gopts, argv) or 0 | 874 | result = repo._Run(name, gopts, argv) or 0 |
| 874 | except RepoExitError as e: | 875 | except RepoExitError as e: |
| 875 | exception_name = type(e).__name__ | 876 | if not isinstance(e, SilentRepoExitError): |
| 877 | exception_name = type(e).__name__ | ||
| 878 | print("fatal: %s" % e, file=sys.stderr) | ||
| 879 | if e.aggregate_errors: | ||
| 880 | print(f"{exception_name} Aggregate Errors") | ||
| 881 | for err in e.aggregate_errors[:MAX_PRINT_ERRORS]: | ||
| 882 | print(err) | ||
| 883 | if ( | ||
| 884 | e.aggregate_errors | ||
| 885 | and len(e.aggregate_errors) > MAX_PRINT_ERRORS | ||
| 886 | ): | ||
| 887 | diff = len(e.aggregate_errors) - MAX_PRINT_ERRORS | ||
| 888 | print(f"+{diff} additional errors ...") | ||
| 876 | result = e.exit_code | 889 | result = e.exit_code |
| 877 | print("fatal: %s" % e, file=sys.stderr) | ||
| 878 | if e.aggregate_errors: | ||
| 879 | print(f"{exception_name} Aggregate Errors") | ||
| 880 | for err in e.aggregate_errors[:MAX_PRINT_ERRORS]: | ||
| 881 | print(err) | ||
| 882 | if len(e.aggregate_errors) > MAX_PRINT_ERRORS: | ||
| 883 | diff = len(e.aggregate_errors) - MAX_PRINT_ERRORS | ||
| 884 | print(f"+{diff} additional errors ...") | ||
| 885 | except KeyboardInterrupt: | 890 | except KeyboardInterrupt: |
| 886 | print("aborted by user", file=sys.stderr) | 891 | print("aborted by user", file=sys.stderr) |
| 887 | result = KEYBOARD_INTERRUPT_EXIT | 892 | result = KEYBOARD_INTERRUPT_EXIT |
