Bug #25816

Improve error handling for invalid types

Added by Robert Lemke over 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Utility
Start date:
2011-04-07
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

After introducing the Utility\TypeHandling functions, an InvalidArgumentException is thrown if some @var annotation uses a wrong type (and certainly also if invalid types are used elsewhere). However, the exception doesn't (and can't) give any hint where the invalid type was declared.

We have two options to improve this:

1) let the TypeHandling functions return FALSE if the type could not be parsed and throw a proper exception in the calling method
2) let the calling method catch the TypeHandling exceptions and rethrow a better exception

I'm all for solution 1)

Also available in: Atom PDF