Fixed Exception class in "Informative Exceptions"

The example in the "Informative Exceptions" section uses InvalidArgumentException, which is incorrect as that class does not have a getFullMessage() method. The class that defines getFullMessage() is AbstractNestedException, of which DomainException is a subclass, so I've replaced InvalidArgumentException with that to make the example accurate.
This commit is contained in:
Matthew Turland 2014-07-25 09:22:47 -05:00
parent 880f02b6bb
commit a379977b2c

View file

@ -113,7 +113,7 @@ we use the `assert()` method instead of `validate()`:
```php
try {
$usernameValidator->assert('really messed up screen#name');
} catch(\InvalidArgumentException $e) {
} catch(DomainException $e) {
echo $e->getFullMessage();
}
```