Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better exception handling #8

Open
kerberizer opened this issue Jul 2, 2020 · 0 comments
Open

Better exception handling #8

kerberizer opened this issue Jul 2, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kerberizer
Copy link
Member

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'>
@kerberizer kerberizer added enhancement New feature or request good first issue Good for newcomers labels Jul 2, 2020
@kerberizer kerberizer self-assigned this Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant