Commit 564597f7 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Ligne de commande de test d'archivabilité du manuscrit de thèse PDF :...

[FIX] Ligne de commande de test d'archivabilité du manuscrit de thèse PDF : amélioration du message en cas d'erreur.
parent 35a434ec
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ Journal des modifications
- Saise d'une thèse : recherche/utilisation d'un éventuel doctorant existant en cas de création ; impossible de changer le doctorant d'une thèse existante ; meilleure remontée/affichage d'erreur.
- Admission : ajout du bouton de suppression d'un dossier d'admission dans le formulaire de modification.
- Admission : utilisation d'une transaction globale pour la suppression d'un dossier d'admission.
- [FIX] Ligne de commande de test d'archivabilité du manuscrit de thèse PDF : amélioration du message en cas d'erreur.
- [FIX] Inscriptions administratives importées : refetch de l'IA pour être sûr d'avoir les jointures correctes.
- [FIX] Ligne de commande de retraitement du manuscrit de thèse PDF : correction d'un appel de méthode erroné.

+1 −1
Changes for module/Fichier/src/Fichier/Command/TestArchivabiliteShellCommand.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -90,6 +90,6 @@ class TestArchivabiliteShellCommand extends ShellCommand

    public function createResult(array $output, int $returnCode): ShellCommandResult
    {
        return new TestArchivabiliteShellCommandResult($output, $returnCode);
        return new TestArchivabiliteShellCommandResult($this, $output, $returnCode);
    }
}
 No newline at end of file
+12 −8
Changes for module/Fichier/src/Fichier/Command/TestArchivabiliteShellCommandResult.php: 12 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -3,9 +3,9 @@
namespace Fichier\Command;

use Application\Command\ShellCommandResult;
use DOMDocument;
use Fichier\Command\Exception\TestArchivabiliteCommandException;
use Fichier\Validator\Exception\CinesErrorException;
use DOMDocument;
use UnicaenApp\Exception\RuntimeException;

class TestArchivabiliteShellCommandResult extends ShellCommandResult
@@ -22,23 +22,27 @@ class TestArchivabiliteShellCommandResult extends ShellCommandResult
    public const XML_TAG_FORMAT = 'format';
    public const XML_TAG_VERSION = 'version';

    protected TestArchivabiliteShellCommand $command;

    /**
     * @var string XML retourné par le web service.
     */
    protected $xml;
    protected string $xml;

    /**
     * @param array $output
     * @param int $returnCode
     */
    public function __construct(array $output, int $returnCode)
    public function __construct(TestArchivabiliteShellCommand $command, array $output, int $returnCode)
    {
        parent::__construct($output, $returnCode);

        $this->command = $command;

        try {
            $this->detectErrorFromCommandExecutionResults();
        } catch (TestArchivabiliteCommandException $cee) {
            throw new RuntimeException(sprintf("La ligne de commande 'XXXX' a échoué. %s", $cee->getMessage()));
            throw new RuntimeException(sprintf(
                "La ligne de commande '%s' a échoué. %s",
                $this->command->getCommandLine(),
                $cee->getMessage()
            ));
        }

        $this->xml = trim(implode(PHP_EOL, $this->output));