diff --git a/locales/en.json b/locales/en.json index e4f785002..50ef2ddf1 100644 --- a/locales/en.json +++ b/locales/en.json @@ -20,7 +20,7 @@ "app_location_already_used": "An app is already installed in this location", "app_location_install_failed": "Unable to install the app in this location", "app_location_unavailable": "This url is not available or conflicts with an already installed app", - "app_manifest_invalid": "Invalid app manifest", + "app_manifest_invalid": "Invalid app manifest: {error}", "app_no_upgrade": "No app to upgrade", "app_not_correctly_installed": "{app:s} seems to be incorrectly installed", "app_not_installed": "{app:s} is not installed", diff --git a/src/yunohost/app.py b/src/yunohost/app.py index aa76cfc7f..bb81efeeb 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1424,6 +1424,9 @@ def _extract_app_from_file(path, remove=False): manifest['lastUpdate'] = int(time.time()) except IOError: raise MoulinetteError(errno.EIO, m18n.n('app_install_files_invalid')) + except ValueError as e: + raise MoulinetteError(errno.EINVAL, + m18n.n('app_manifest_invalid', error=e.strerror)) logger.info(m18n.n('done')) @@ -1517,9 +1520,9 @@ def _fetch_app_from_git(app): except subprocess.CalledProcessError: raise MoulinetteError(errno.EIO, m18n.n('app_sources_fetch_failed')) - except IOError: + except ValueError as e: raise MoulinetteError(errno.EIO, - m18n.n('app_manifest_invalid')) + m18n.n('app_manifest_invalid', error=e.strerror)) else: logger.info(m18n.n('done')) @@ -1574,9 +1577,9 @@ def _fetch_app_from_git(app): except subprocess.CalledProcessError: raise MoulinetteError(errno.EIO, m18n.n('app_sources_fetch_failed')) - except IOError: + except ValueError as e: raise MoulinetteError(errno.EIO, - m18n.n('app_manifest_invalid')) + m18n.n('app_manifest_invalid', error=e.strerror)) else: logger.info(m18n.n('done'))