Trap 404s and return Rest_Exception instead. Fixes ticket #1213.

This commit is contained in:
Bharat Mediratta
2010-07-16 12:16:20 -07:00
parent 5fd166724b
commit ed704e6a3b

View File

@@ -87,6 +87,8 @@ class Rest_Controller extends Controller {
// either need to map the result values to localized strings in the application code, or every
// client needs its own l10n string set.
throw new Rest_Exception("Bad Request", 400, $e->validation->errors());
} catch (Kohana_404_Exception $e) {
throw new Rest_Exception("Not Found", 404);
}
}
}