From ca92eaa5e736f692f24f03c5fc51cb8514b182e1 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 16 Mar 2011 12:11:52 +0100 Subject: [PATCH] removed namespace from exception type --- lib/View/JSON.php | 4 +++- lib/View/XML.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/View/JSON.php b/lib/View/JSON.php index e25cd66..4fe0fe3 100644 --- a/lib/View/JSON.php +++ b/lib/View/JSON.php @@ -173,9 +173,10 @@ class JSON extends View { * @param boolean $debug */ protected function addException(\Exception $exception) { + $exceptionType = explode('\\', get_class($exception)); $exceptionInfo = array( 'message' => $exception->getMessage(), - 'type' => get_class($exception), + 'type' => end($exceptionType), 'code' => $exception->getCode() ); @@ -211,6 +212,7 @@ class JSON extends View { $this->json['data']['uuid'] = $interpreter->getEntity()->getUuid(); $this->json['data']['count'] = count($data); + $this->json['data']['rowCount'] = $interpreter->getRowCount(); $min = $interpreter->getMin(); $max = $interpreter->getMax(); diff --git a/lib/View/XML.php b/lib/View/XML.php index 3ce4a06..6167b13 100644 --- a/lib/View/XML.php +++ b/lib/View/XML.php @@ -183,9 +183,11 @@ class XML extends View { * @param boolean $debug */ protected function addException(\Exception $exception) { + $exceptionType = explode('\\', get_class($exception)); + $xmlException = $this->xmlDoc->createElement('exception'); $xmlException->setAttribute('code', $exception->getCode()); - $xmlException->setAttribute('type', get_class($exception)); + $xmlException->setAttribute('type', end($exceptionType)); $xmlException->appendChild($this->xmlDoc->createElement('message', $exception->getMessage()));