Permalink
Browse files

Merge pull request #8 from gavD/handled-exceptions-error-code

Add error code to handled exceptions
  • Loading branch information...
2 parents fc958bd + 95011c3 commit 67dc7155baafca789a03674fffcfa55f25afa769 @nateabele committed May 20, 2014
Showing with 4 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +3 −2 action/Resource.php
View
@@ -0,0 +1 @@
+composer.lock
View
@@ -258,8 +258,9 @@ public function __invoke($request, array $params = array()) {
throw $e;
}
$result = $e;
+ $status = $e->getCode() ?: 500;
}
- return $this->_response($request, $result, $data, compact('state', 'params', 'method'));
+ return $this->_response($request, $result, $data, compact('state', 'params', 'method', 'status'));
}
/**
@@ -308,4 +309,4 @@ protected function _export($request) {
}
}
-?>
+?>

0 comments on commit 67dc715

Please sign in to comment.