add type to WrongFiletypeException
This commit is contained in:
parent
1a11d220a9
commit
992ce8a37c
3 changed files with 29 additions and 5 deletions
|
|
@ -67,7 +67,7 @@
|
|||
}
|
||||
if(is_null($answerMimetype)) {
|
||||
throw new \hhu\z\exceptions\SubmissionNotValidException(
|
||||
new \hhu\z\exceptions\WrongFiletypeException()
|
||||
new \hhu\z\exceptions\WrongFiletypeException($answer['type'])
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php if(!is_null($exception)) : ?>
|
||||
<p class="error">
|
||||
<?php if($exception->getNestedException() instanceof \hhu\z\exceptions\WrongFiletypeException) : ?>
|
||||
<?=_('File has wrong type')?>
|
||||
<?=sprintf(_('File has wrong type “%s”'), $exception->getNestedException()->getType())?>
|
||||
<?php elseif($exception->getNestedException() instanceof \hhu\z\exceptions\WrongFiletypeException) : ?>
|
||||
<?=_('File exceeds size maximum')?>
|
||||
<?php elseif($exception->getNestedException() instanceof \hhu\z\exceptions\FileUploadException) : ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue