Skip to content

Commit

Permalink
optimize: print original error if 'tasklist' fails
Browse files Browse the repository at this point in the history
printing the original error may be helpful for
troubleshooting issues like #456 and #367.
  • Loading branch information
coolkiid committed Sep 9, 2024
1 parent dd66499 commit 9388320
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,18 @@ def getLolClientPid(path):


def getLolClientPids(path):
processes = subprocess.check_output(
f'{path} /FI "imagename eq LeagueClientUx.exe" /NH', shell=True)
try:
processes = subprocess.check_output(
f'{path} /FI "imagename eq LeagueClientUx.exe" /NH',
shell=True,
stderr=subprocess.STDOUT
)
except subprocess.CalledProcessError as e:
logger.error(
'an error occurred when calling tasklist command, '
f'original output: {e.output.decode()}'
)
raise e

pids = []

Expand Down

0 comments on commit 9388320

Please sign in to comment.