Skip to content

Commit

Permalink
fix: error handling for displaying pacman errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ouuan committed Jun 30, 2024
1 parent e837821 commit 30ed096
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pacwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ def pacman(args: str, display: bool, noConfirm: bool = True, check: bool = True)
except subprocess.CalledProcessError as e:
print('\n--- pacman error ---\n')
print('exit code: {}'.format(e.returncode))
print('stderr: {}'.format(e.stderr.decode()))
print('stdout: {}'.format(e.output.decode()))
try:
print('stderr: {}'.format(e.stderr.decode()))
except:
pass
try:
print('stdout: {}'.format(e.output.decode()))
except:
pass
print('\n--- pacman error ---\n')
raise e

Expand Down

0 comments on commit 30ed096

Please sign in to comment.