Skip to content

Commit

Permalink
Merge pull request #458 from coolkiid/optimize/print-error-if-tasklis…
Browse files Browse the repository at this point in the history
…t-fails

optimize: print original error if 'tasklist' fails
  • Loading branch information
Zzaphkiel authored Sep 10, 2024
2 parents cd76956 + 9388320 commit bfc1042
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 bfc1042

Please sign in to comment.