Skip to content

Better exception handling #8

@kerberizer

Description

@kerberizer

We shouldn't allow transient errors to trigger unhandled exceptions like this:

Syncing repo "/home/jss9/.local/share/git-sync/repos/wikipedia-lua/.git"...
Traceback (most recent call last):
  File "/home/jss9/.local/lib/git-sync/git-sync.py", line 361, in <module>
    main(sys.argv[1:])
  File "/home/jss9/.local/lib/git-sync/git-sync.py", line 353, in main
    repo.sync()
  File "/home/jss9/.local/lib/git-sync/git-sync.py", line 331, in sync
    self._pull()
  File "/home/jss9/.local/lib/git-sync/git-sync.py", line 187, in _pull
    self.repo.git.pull()
  File "/usr/lib/python3.8/site-packages/git/cmd.py", line 542, in <lambda>
    return lambda *args, **kwargs self._call_process(name, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/git/cmd.py", line 1005, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/usr/lib/python3.8/site-packages/git/cmd.py", line 822, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError Cmd('git') failed due to exit code(1)
  cmdline git pull
  stderr 'ssh Could not resolve hostname github.com Name or service not known
fatal Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.'
CRITICAL Exiting due to uncaught exception <class 'git.exc.GitCommandError'>

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions