Verified Commit 80f9510e authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Fix code when no connector found

parent 624ecfb5
Pipeline #18869 canceled with stages
...@@ -71,7 +71,9 @@ class ArchiveTransfer extends abstractMessage ...@@ -71,7 +71,9 @@ class ArchiveTransfer extends abstractMessage
*/ */
public function receiveSource($package, $connector, $params = []) public function receiveSource($package, $connector, $params = [])
{ {
if (!isset($this->packageConnectors[$connector]) || empty($this->packageConnectors[$connector])) { if (!isset($this->packageConnectors[$connector])
|| empty($this->packageConnectors[$connector])
|| !isset($this->packageConnectors[$connector]['service'])) {
throw \laabs::newException('medona/invalidMessageException', "Invalid message: unknown connector", 400); throw \laabs::newException('medona/invalidMessageException', "Invalid message: unknown connector", 400);
} }
...@@ -87,19 +89,10 @@ class ArchiveTransfer extends abstractMessage ...@@ -87,19 +89,10 @@ class ArchiveTransfer extends abstractMessage
$params = $this->checkParamsConstraints($confParams, $params); $params = $this->checkParamsConstraints($confParams, $params);
$message = $this->createNewMessage($schema); $message = $this->createNewMessage($schema);
$messageDirectory = $this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId;
if (isset($connectorConf['service'])) { $connectorService = \laabs::newService($connectorConf['service']);
$connectorService = \laabs::newService($connectorConf['service']); $message->path = $connectorService->receive($package, $params, $messageDirectory);
$message->path = $connectorService->receive(
$package,
$params,
$this->messageDirectory.DIRECTORY_SEPARATOR.(string) $message->messageId
);
} else {
$messageFile = $package;
$attachments = [];
}
// Traiter le schéma spécifique // Traiter le schéma spécifique
$this->receiveMessage($message); $this->receiveMessage($message);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment