Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
kduret committed Aug 4, 2022
1 parent 42a5560 commit c927b1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
14 changes: 10 additions & 4 deletions lang/fr_FR.UTF-8/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -16964,8 +16964,14 @@ msgstr "Le module \"%s\" est manquant"
msgid "An error occured while retrieving details of module \"%s\""
msgstr "Une erreur s'est produite lors de la récupération des informations détaillées du module \"%s\""

msgid "Required Centreon installed version is %s"
msgstr "La version installée de Centreon requise est %s"
msgid "Centreon database schema seems not installed."
msgstr "Le schema de base de données de Centreon ne semble pas installé."

msgid "Required Centreon installed version is %s (%s installed)"
msgstr "La version installée de Centreon requise est %s (%s installée)"
msgid "Centreon database schema version is \"%s\" (\"%s\" required)."
msgstr "La version du schema de base de données de Centreon est \"%s\" (\"%s\" requise)."

msgid "Please use Web UI to install Centreon."
msgstr "Veuillez utiliser l'interface Web pour installer Centreon."

msgid "Please use Web UI to update Centreon."
msgstr "Veuillez utiliser l'interface Web pour mettre à jour Centreon."
11 changes: 8 additions & 3 deletions src/EventSubscriber/UpdateEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ public function validateCentreonWebVersionOrFail(RequestEvent $event): void
$currentVersion = $this->readVersionRepository->findCurrentVersion();

if ($currentVersion === null) {
$errorMessage = sprintf('Required Centreon installed version is %s', self::MINIMAL_INSTALLED_VERSION);
$errorMessage =
_('Centreon database schema seems not installed.')
. ' '
. _('Please use Web UI to install Centreon.');
$this->error($errorMessage);
throw new \Exception(_($errorMessage));
}
Expand All @@ -88,9 +91,11 @@ public function validateCentreonWebVersionOrFail(RequestEvent $event): void
);
if (version_compare($currentVersion, self::MINIMAL_INSTALLED_VERSION, '<')) {
$errorMessage = sprintf(
'Required Centreon installed version is %s (%s installed)',
self::MINIMAL_INSTALLED_VERSION,
_('Centreon database schema version is "%s" ("%s" required).')
. ' '
. _('Please use Web UI to update Centreon.'),
$currentVersion,
self::MINIMAL_INSTALLED_VERSION,
);
$this->debug($errorMessage);
throw new \Exception(_($errorMessage));
Expand Down

0 comments on commit c927b1a

Please sign in to comment.