Better error

This commit is contained in:
Daniil Gentili 2017-05-08 20:10:01 +01:00
parent a3c4f69e5d
commit dc7b2bae2d

View File

@ -297,6 +297,9 @@ trait TL
case '!X':
return $object;
case 'Vector t':
if (!$this->is_array($object)) {
throw new Exception("You didn't provide a valid array");
}
$concat = \danog\PHP\Struct::pack('<i', $this->constructors->find_by_predicate('vector')['id']);
$concat .= \danog\PHP\Struct::pack('<i', count($object));
foreach ($object as $current_object) {