Project

General

Profile

Anomalie #16417

[REST] Message d’erreur manquant sur POST /rest/resources

Added by Quentin RIBAC about 1 year ago. Updated 11 months ago.

Status:
Développé / Analysé (S)
Priority:
2-Sérieux
Assignee:
Florian AZIZIAN
Target version:
Start date:
02/26/2021
Due date:
Tags Courrier:
20.10.7

Description

Bonjour,

Lors de la création d’un courrier via POST /rest/resources, si on spécifie un élément senders ou recipients avec un ID null, l’API REST ne renvoie pas de message d’erreur mais il se produit une erreur 500.

J’ai trouvé ce comportement un débuggant un script dans lequel j’avais effectivement oublié de faire la vérification de valeur nulle sur ce champ. L’erreur est originellement la mienne, mais avec un message d’erreur clair j’aurais sûrement gagné plus d’une demi-journée de recherche.

Testé aujourd’hui (26 fév. 2021) sur Maarch Courrier 20.10.6.

Corps de la requête :

POST http://localhost/MaarchCourrier2010/locale2010/rest/ressources avec cchaplin en BasicAuth.

{
"customFields":{},
"status":"NEW",
"doctype":101,
"priority":"poiuytre1357nbvc",
"documentDate":"17-02-2021",
"arrivalDate":"26-02-2021",
"subject":"test",
"destination":6,
"processLimitDate":"12-04-2021 23:59:59",
"diffusionList":[{"id":19,"mode":"dest","type":"user"},{"id":1,"mode":"cc","type":"entity"}],
"modelId":1,
"followed":false,
"chrono":true,
"encodedFile":"olala42==",
"format":"txt",
"senders":[{"type":"contact","id":null,"label":"Bernard PASCONTENT"}]
}

Le null sur la dernière ligne est la source de l’erreur.

Pouvez-vous rajouter le message d’erreur dans la sortie de l’API ?

History

#1 Updated by Emmanuel DILLARD about 1 year ago

  • Status changed from A qualifier to A étudier
  • Assignee changed from EDI PO to Emmanuel DILLARD

#2 Updated by Emmanuel DILLARD about 1 year ago

  • Assignee changed from Emmanuel DILLARD to Florian AZIZIAN

#3 Updated by Florian AZIZIAN about 1 year ago

  • Status changed from A étudier to Prêt à développer

Erreur reproduit sur la develop :

<h1>Slim Application Error</h1><p>The application could not run because of the following error:</p>
<h2>Details</h2><div><strong>Type:</strong> Exception</div><div><strong>Message:</strong> Argument id is empty</div><div>
<strong>File:</strong> /var/www/html/maarch_v2/src/core/models/ValidatorModel.php</div><div><strong>Line:</strong> 31</div><h2>Trace</h2>
<pre>#0 /var/www/html/maarch_v2/src/app/contact/models/ContactModel.php(45): SrcCore\models\ValidatorModel::notEmpty(Array, Array)
#1 /var/www/html/maarch_v2/src/app/resource/controllers/ResourceControlController.php(300): Contact\models\ContactModel::getById(Array)
#2 /var/www/html/maarch_v2/src/app/resource/controllers/ResourceControlController.php(77): Resource\controllers\ResourceControlController::controlAdjacentData(Array)
#3 /var/www/html/maarch_v2/src/app/resource/controllers/ResController.php(71): Resource\controllers\ResourceControlController::controlResource(Array)

#4 Updated by Florian AZIZIAN about 1 year ago

  • Assignee deleted (Florian AZIZIAN)

#5 Updated by Emmanuel DILLARD about 1 year ago

  • Project changed from Backlog to CURRENT SPRINT
  • Status changed from Prêt à développer to En cours de dev (S)
  • Target version changed from Courrier 20.10.xx to Courrier 21.03 (stable)
  • Tags Courrier 20.10.7 added

#6 Updated by Emmanuel DILLARD about 1 year ago

  • Due date set to 03/10/2021

#8 Updated by Florian AZIZIAN about 1 year ago

  • Assignee set to Florian AZIZIAN

#9 Updated by Florian AZIZIAN about 1 year ago

  • Assignee deleted (Florian AZIZIAN)

#10 Updated by Florian AZIZIAN about 1 year ago

  • Assignee set to Florian AZIZIAN

#11 Updated by Florian AZIZIAN about 1 year ago

  • Status changed from En cours de dev (S) to Développé / Analysé (S)

#12 Updated by Emmanuel DILLARD about 1 year ago

  • Project changed from CURRENT SPRINT to Backlog
  • Due date deleted (03/10/2021)

#14 Updated by Emmanuel DILLARD 11 months ago

  • Project changed from Backlog to Backlog Courrier
  • Target version changed from Courrier 21.03 (stable) to 21.03 (stable)

Also available in: Atom PDF