mirror of
https://github.com/lutris/lutris
synced 2024-09-05 23:46:21 +00:00
Replace DIRECTORY_NOT_FOUND errors with exceptions.
We didn't have handing, so this was an "unknown error". I'll borrow the handling from easyrpg so you can get a better message here.
This commit is contained in:
parent
21694376ce
commit
bc902394b0
|
@ -1,6 +1,7 @@
|
|||
# Standard Library
|
||||
from gettext import gettext as _
|
||||
|
||||
from lutris.exceptions import DirectoryNotFoundError
|
||||
# Lutris Modules
|
||||
from lutris.runners.runner import Runner
|
||||
from lutris.util import system
|
||||
|
@ -64,7 +65,7 @@ class cemu(Runner):
|
|||
mlc = self.runner_config.get("mlc")
|
||||
if mlc:
|
||||
if not system.path_exists(mlc):
|
||||
return {"error": "DIRECTORY_NOT_FOUND", "directory": mlc}
|
||||
raise DirectoryNotFoundError(directory=mlc)
|
||||
arguments += ["-m", mlc]
|
||||
ud = self.runner_config.get("ud")
|
||||
if ud:
|
||||
|
@ -77,6 +78,6 @@ class cemu(Runner):
|
|||
arguments.append("--legacy")
|
||||
gamedir = self.game_config.get("main_file") or ""
|
||||
if not system.path_exists(gamedir):
|
||||
return {"error": "DIRECTORY NOT FOUND", "directory": gamedir}
|
||||
raise DirectoryNotFoundError(directory=gamedir)
|
||||
arguments += ["-g", gamedir]
|
||||
return {"command": arguments}
|
||||
|
|
Loading…
Reference in a new issue