Skip to content

Commit

Permalink
Improve descriptiveness of exception message
Browse files Browse the repository at this point in the history
I found this exception a little obscure, especially as the things which it needs are detailed in the function. It could tell me what's actually missing.
  • Loading branch information
davidyell committed Nov 9, 2016
1 parent cfdf2b7 commit 04ee27d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ORM/Table.php
Expand Up @@ -1728,7 +1728,8 @@ protected function _update($entity, $data)
}

if (!$entity->has($primaryColumns)) {
$message = 'All primary key value(s) are needed for updating';
$message = 'All primary key value(s) are needed for updating, ';
$message .= get_class($entity) . ' is missing ' . implode(', ', $primaryColumns);
throw new InvalidArgumentException($message);
}

Expand Down

0 comments on commit 04ee27d

Please sign in to comment.