Skip to content

Commit

Permalink
Vylepšení exception podle standardního formátu
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Szekeres committed Jul 20, 2018
1 parent 2eb25a5 commit 6a5ca6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Components/AjaxSelect/Traits/InvalidSetValueTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ protected abstract function processValues($value);
protected function handleInvalidValues($values) {
switch ($this->getInvalidValueMode()) {
case AjaxSelect\DI\AjaxSelectExtension::INVALID_VALUE_MODE_EXCEPTION:
throw new \Nette\InvalidArgumentException;
$set = \Nette\Utils\Strings::truncate(implode(', ', array_map(function ($s) { return var_export($s, TRUE); }, array_keys($this->items))), 70, '...');

throw new \Nette\InvalidArgumentException("Value '$values' is out of allowed set [$set] in field '{$this->name}'.");

case AjaxSelect\DI\AjaxSelectExtension::INVALID_VALUE_MODE_EMPTY:
return $this instanceof AjaxSelect\Interfaces\IMultiSelectControl
Expand Down

0 comments on commit 6a5ca6b

Please sign in to comment.