mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
appsv2: missing raw_msg=True for exceptions
This commit is contained in:
parent
aa9bc47aa6
commit
1d1a3756ba
1 changed files with 8 additions and 5 deletions
|
@ -302,7 +302,8 @@ class PermissionsResource(AppResource):
|
|||
and properties["main"]["url"] != "/"
|
||||
):
|
||||
raise YunohostError(
|
||||
"URL for the 'main' permission should be '/' for webapps (or undefined/None for non-webapps). Note that / refers to the install url of the app"
|
||||
"URL for the 'main' permission should be '/' for webapps (or undefined/None for non-webapps). Note that / refers to the install url of the app",
|
||||
raw_msg=True
|
||||
)
|
||||
|
||||
super().__init__({"permissions": properties}, *args, **kwargs)
|
||||
|
@ -470,12 +471,12 @@ class SystemuserAppResource(AppResource):
|
|||
if check_output(f"getent passwd {self.app} &>/dev/null || true").strip():
|
||||
os.system(f"deluser {self.app} >/dev/null")
|
||||
if check_output(f"getent passwd {self.app} &>/dev/null || true").strip():
|
||||
raise YunohostError(f"Failed to delete system user for {self.app}")
|
||||
raise YunohostError(f"Failed to delete system user for {self.app}", raw_msg=True)
|
||||
|
||||
if check_output(f"getent group {self.app} &>/dev/null || true").strip():
|
||||
os.system(f"delgroup {self.app} >/dev/null")
|
||||
if check_output(f"getent group {self.app} &>/dev/null || true").strip():
|
||||
raise YunohostError(f"Failed to delete system user for {self.app}")
|
||||
raise YunohostError(f"Failed to delete system user for {self.app}", raw_msg=True)
|
||||
|
||||
# FIXME : better logging and error handling, add stdout/stderr from the deluser/delgroup commands...
|
||||
|
||||
|
@ -743,7 +744,8 @@ class AptDependenciesAppResource(AppResource):
|
|||
isinstance(values.get(k), str) for k in ["repo", "key", "packages"]
|
||||
):
|
||||
raise YunohostError(
|
||||
"In apt resource in the manifest: 'extras' repo should have the keys 'repo', 'key' and 'packages' defined and be strings"
|
||||
"In apt resource in the manifest: 'extras' repo should have the keys 'repo', 'key' and 'packages' defined and be strings",
|
||||
raw_msg=True
|
||||
)
|
||||
|
||||
super().__init__(properties, *args, **kwargs)
|
||||
|
@ -860,7 +862,8 @@ class PortsResource(AppResource):
|
|||
if infos["fixed"]:
|
||||
if self._port_is_used(port_value):
|
||||
raise YunohostValidationError(
|
||||
f"Port {port_value} is already used by another process or app."
|
||||
f"Port {port_value} is already used by another process or app.",
|
||||
raw_msg=True
|
||||
)
|
||||
else:
|
||||
while self._port_is_used(port_value):
|
||||
|
|
Loading…
Add table
Reference in a new issue