ChimeraOS / chimera

A web interface for managing Steam remotely
MIT License
231 stars 26 forks source link

Catch EGS authentication errors #280

Closed alkazar closed 7 months ago

alkazar commented 1 year ago

When EGS token expires, the following error occurs:

Server error:

Apr 23 18:39:28 chimeraos chimera[1237]:   File "/usr/lib/python3.10/site-packages/chimera_app/platforms/store_platform.py", line 25, in get_installed_content
Apr 23 18:39:28 chimeraos chimera[1237]:     apps = self._get_all_content()
Apr 23 18:39:28 chimeraos chimera[1237]:   File "/usr/lib/python3.10/site-packages/chimera_app/platforms/epic_store.py", line 68, in _get_all_content
Apr 23 18:39:28 chimeraos chimera[1237]:     for line in subprocess.check_output(["legendary", "list-games", "--csv"]).splitlines()[1:]:
Apr 23 18:39:28 chimeraos chimera[1237]:   File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
Apr 23 18:39:28 chimeraos chimera[1237]:     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
Apr 23 18:39:28 chimeraos chimera[1237]:   File "/usr/lib/python3.10/subprocess.py", line 526, in run
Apr 23 18:39:28 chimeraos chimera[1237]:     raise CalledProcessError(retcode, process.args,
Apr 23 18:39:28 chimeraos chimera[1237]: subprocess.CalledProcessError: Command '['legendary', 'list-games', '--csv']' returned non-zero exit status 1.
Apr 23 18:39:28 chimeraos chimera[1237]: 127.0.0.1 - - [23/Apr/2023:18:39:28 -0400] "GET /library/epic-store HTTP/1.1" 500 747 "http://ti/library" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0"

Error when running the same command from the cli:

[gamer@chimeraos ~]$ legendary list-games --csv
[cli] INFO: Logging in...
Traceback (most recent call last):
  File "/usr/bin/legendary", line 33, in <module>
    sys.exit(load_entry_point('legendary-gl==0.20.32', 'console_scripts', 'legendary')())
  File "/usr/lib/python3.10/site-packages/legendary/cli.py", line 2972, in main
    cli.list_games(args)
  File "/usr/lib/python3.10/site-packages/legendary/cli.py", line 190, in list_games
    if not self.core.login():
  File "/usr/lib/python3.10/site-packages/legendary/core.py", line 187, in login
    raise ValueError('No saved credentials')
ValueError: No saved credentials

We should catch the error and handle it better than just showing a 500 internal server error.

mdeguzis commented 8 months ago

I may have hit this today and posted in the discord help section. I'll check the CLI later. Indeed it's very frustrating when you don't know why it's not working.

alkazar commented 7 months ago

This should be fixed in the latest release.