try {
// original method body here
} catch (Exception $caughtException) {
Method $method = getExceptionHandlerMethod($caughtException.getClass())
if($method) {
return $method.invoke(this, $caughtException)
} else {
throw $caughtException
}
}