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

Merge branch 'issue312_error_messages' into develop

parents 77c70326 d6962fe0
Branches
Tags
No related merge requests found
......@@ -29,10 +29,16 @@ class Controller_Handler_Rating extends Controller_Handler
$_POST['submoduleID'],
$_POST['rate']
);
if (!is_null($error))
throw HTTP_Exception::factory($error['code'], $error['message']);
$this->response->body(json_encode([ 'success' => true ]));
if (!is_null($error)) {
if (!is_null($error['message'])) {
$this->response->body(json_encode(['success' => false, 'message' => $error['message']]));
$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() {
......
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