From 6673774d48a2b41f5ba7c962a23655f2a11b9314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Scho=CC=88nthal?= Date: Thu, 12 Jun 2014 14:01:26 +0200 Subject: [PATCH] error handling --- src/YumlPhp/Request/ClassesRequest.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/YumlPhp/Request/ClassesRequest.php b/src/YumlPhp/Request/ClassesRequest.php index 0142331..5b5dbe0 100644 --- a/src/YumlPhp/Request/ClassesRequest.php +++ b/src/YumlPhp/Request/ClassesRequest.php @@ -12,6 +12,7 @@ namespace YumlPhp\Request; use TokenReflection\Broker; +use TokenReflection\Exception\BaseException; use TokenReflection\IReflectionClass; use TokenReflection\IReflectionMethod; use TokenReflection\IReflectionProperty; @@ -59,13 +60,17 @@ public function configure(array $config) */ protected function getClasses() { - $broker = new Broker(new Broker\Backend\Memory()); - $broker->processDirectory(realpath($this->path), $this->config['filter']); - $classes = $broker->getClasses(); + try { + $broker = new Broker(new Broker\Backend\Memory()); + $broker->processDirectory(realpath($this->path), $this->config['filter']); + $classes = $broker->getClasses(); - sort($classes); + sort($classes); - return $classes; + return $classes; + } catch (BaseException $e) { + throw new \RuntimeException($e->getDetail()); + } } /**