diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-31 11:51:51 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-31 11:51:51 -0800 |
commit | 1a12a5e3c89c41ebd087591c16611fbab4293f5b (patch) | |
tree | edba677930997890f1a9a24922bcd06f2dd7ed14 /modules/tag/helpers | |
parent | 732047e9c3cbd178acd07c531ed78afade9a4918 (diff) |
Create a Rest_Exception class and use it to convey status to the client instead of calling rest::forbidden and other rest helper error messages.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/tag_rest.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php index cfcf93b2..29b74510 100644 --- a/modules/tag/helpers/tag_rest.php +++ b/modules/tag/helpers/tag_rest.php @@ -60,7 +60,7 @@ class tag_rest_Core { static function post($request) { if (empty($request->arguments) || count($request->arguments) != 1 || empty($request->path)) { - return rest::invalid_request(); + Rest_Exception::trigger(400, "Bad request"); } $path = $request->path; $tags = explode(",", $request->arguments[0]); @@ -85,7 +85,7 @@ class tag_rest_Core { static function put($request) { if (empty($request->arguments[0]) || empty($request->new_name)) { - return rest::invalid_request(); + Rest_Exception::trigger(400, "Bad request"); } $name = $request->arguments[0]; @@ -105,7 +105,7 @@ class tag_rest_Core { static function delete($request) { if (empty($request->arguments[0])) { - return rest::invalid_request(); + Rest_Exception::trigger(400, "Bad request"); } $tags = explode(",", $request->arguments[0]); if (!empty($request->path)) { |