diff --git a/src/Core/System.php b/src/Core/System.php index 69d15a1764..45a88fe093 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -176,6 +176,12 @@ class System extends BaseObject exit(); } + public static function jsonError($httpCode, $data, $content_type = 'application/json') + { + header($_SERVER["SERVER_PROTOCOL"] . ' ' . $httpCode); + self::jsonExit($data, $content_type); + } + /** * @brief Encodes content to json. *