mirror of
https://github.com/opensupports/opensupports.git
synced 2025-04-08 18:35:06 +02:00
Ivan - Fix master issues. Improve error handling
This commit is contained in:
parent
9ec10a356b
commit
2703f82253
server
@ -14,12 +14,11 @@ abstract class Controller {
|
||||
return function () {
|
||||
try {
|
||||
$this->validate();
|
||||
} catch (ValidationException $exception) {
|
||||
$this->handler();
|
||||
} catch (\Exception $exception) {
|
||||
Response::respondError($exception->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
$this->handler();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
class Article extends DataStore {
|
||||
const TABLE = 'article';
|
||||
|
||||
public function getProps() {
|
||||
public static function getProps() {
|
||||
return [
|
||||
'title',
|
||||
'content',
|
||||
|
@ -3,7 +3,7 @@
|
||||
class Topic extends DataStore {
|
||||
const TABLE = 'topic';
|
||||
|
||||
public function getProps() {
|
||||
public static function getProps() {
|
||||
return [
|
||||
'name',
|
||||
'icon',
|
||||
|
Loading…
x
Reference in New Issue
Block a user