added API/Error class to hold error keys as constants

- re-added Setting::getAll() to API/Setting::set() in response
- updated settings/setup tests
This commit is contained in:
Jonathan Labreuille
2016-08-03 15:04:25 +02:00
parent 6675d5a20d
commit 5d2800bc25
6 changed files with 31 additions and 16 deletions

View File

@ -17,7 +17,7 @@ abstract class Endpoint {
) {
if(empty($errors)) {
$errors = array(
'unknown' => __('An unknown error occurred.')
Error::UNKNOWN => __('An unknown error occurred.')
);
}
return new ErrorResponse($errors, $meta, $status);
@ -26,7 +26,7 @@ abstract class Endpoint {
function badRequest($errors = array(), $meta = array()) {
if(empty($errors)) {
$errors = array(
'bad_request' => __('Invalid request parameters.')
Error::BAD_REQUEST => __('Invalid request parameters.')
);
}
return new ErrorResponse($errors, $meta, Response::STATUS_BAD_REQUEST);