Skip to content
Snippets Groups Projects

Issue #3419357: Stop returning 4xx status code in Webhook response

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
@@ -90,7 +90,7 @@ class WebHookController extends ControllerBase {
$remotes = RemoteMapping::loadByRemoteIdentifier('tmgmt_memsource', $project_id);
if (empty($remotes)) {
$this->getLogger('tmgmt_memsource')->warning('Project %id not found.', ['%id' => $project_id]);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 404);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 202);
}
$remote = NULL;
/** @var \Drupal\tmgmt\Entity\RemoteMapping $remote_candidate */
@@ -101,7 +101,7 @@ class WebHookController extends ControllerBase {
}
if (!$remote) {
$this->getLogger('tmgmt_memsource')->warning('File %id not found.', ['%id' => $job_part_id]);
return new Response(new FormattableMarkup('File %id not found.', ['%id' => $job_part_id]), 404);
return new Response(new FormattableMarkup('File %id not found.', ['%id' => $job_part_id]), 202);
}
if ($workflow_level != $last_workflow_level) {
$this->getLogger('tmgmt_memsource')->warning('Workflow level %workflow_level is not the last workflow level %last_workflow_level: project %project_id, job part %job_part_id',
@@ -111,7 +111,7 @@ class WebHookController extends ControllerBase {
'%project_id' => $project_id,
'%job_part_id' => $job_part_id,
]);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 400);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 202);
}
/** @var \Drupal\tmgmt_memsource\Plugin\tmgmt\Translator\MemsourceTranslator $translator_plugin */
$translator_plugin = $remote->getJob()->getTranslator()->getPlugin();
@@ -123,7 +123,7 @@ class WebHookController extends ControllerBase {
'%project_id' => $project_id,
'%job_part_id' => $job_part_id,
]);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 400);
return new Response(new FormattableMarkup('Project %id not found.', ['%id' => $project_id]), 202);
}
$job = $remote->getJob();
Loading