Skip to content
Snippets Groups Projects
Commit f3221fb4 authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

Make both errors code 400

parent 50d9ba36
No related branches found
No related tags found
No related merge requests found
Pipeline #57820 failed
......@@ -215,12 +215,14 @@ class DocumentType extends AbstractType implements EventSubscriberInterface
if (!$submittedData->getUploadedFile() && !$submittedData->getUrl()) {
$error = $this->translator->trans('documentation.document.form.error.fileorurl');
throw new TransformationFailedException($error, 400, /* code */ null, /* previous */ $error, /* user message */ ['{{ what }}' => 'aa'] /* message context for the translater */);
}
if (true === $submittedData->getIsLink() && !$submittedData->getUrl()) {
$error = $this->translator->trans('documentation.document.form.error.missingurl');
throw new TransformationFailedException($error, 401, /* code */ null, /* previous */ $error, /* user message */ ['{{ what }}' => 'aa'] /* message context for the translater */);
throw new TransformationFailedException($error, 400, /* code */ null, /* previous */ $error, /* user message */ ['{{ what }}' => 'aa'] /* message context for the translater */);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment