On Fri, Nov 25, 2011 at 12:56 PM, Christian Kaps
<christian.k...@mohiva.com>wrote:

> I surround my application with a try/catch block to catch uncaught
> exceptions. An autoloader exception could be one of them.
>
> But I use also similar calls to reformat error messages.
>
> try {
>   $class = new ReflectionClass($**annotationName);
> } catch (ClassNotFoundException $e) {
>   $message = "The annotation class `{$annotationName}` cannot be found; ";
>   $message .= "called in DocBlock for: {$this->context->getLocation()**};
> ";
>   throw new ClassNotFoundException($**message, null, $e);
> }
>
>
if(!class_exists('ReflectionClass')){
  // call your error handler here or throw Exception as you like
}
else{
  $class = new ReflectionClass($**annotationName);
}

but in this particular case I don't see how could that class missing
(Reflection is a built in extension, always enabled).

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to