Skip to content
Snippets Groups Projects
Commit d6962fe0 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

FIX: better error messages when failing to change rates close #312

parent f5ebd3c9
Branches
No related merge requests found
...@@ -29,10 +29,16 @@ class Controller_Handler_Rating extends Controller_Handler ...@@ -29,10 +29,16 @@ class Controller_Handler_Rating extends Controller_Handler
$_POST['submoduleID'], $_POST['submoduleID'],
$_POST['rate'] $_POST['rate']
); );
if (!is_null($error)) if (!is_null($error)) {
throw HTTP_Exception::factory($error['code'], $error['message']); if (!is_null($error['message'])) {
$this->response->body(json_encode(['success' => false, 'message' => $error['message']]));
$this->response->body(json_encode([ 'success' => true ])); $this->response->status(400);
} else {
throw HTTP_Exception::factory($error['code'], $error['message']);
}
} else {
$this->response->body(json_encode(['success' => true]));
}
} }
public function action_SetExamPeriodOption() { public function action_SetExamPeriodOption() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment