I use my own simple error handling and can actually catch everything I need. But now I need to catch the error with try{}catch(){} . The error that I sometimes expect in this place is "Error calling undefined method". I can catch it like this:
try { $someObject->someMethodTheObjectDoesntProvide(); } catch (Error $e) {
But the Error class in the catch clause is a bit general. I would like to catch only this type of error.
Is there a way to limit capture to a specific โtypeโ of errors?
Without using strpos($errorMessage) ...;)
source share