Using forked repo and cache engine

This commit is contained in:
Pablo Ferreiro 2022-01-13 16:51:45 +01:00
parent a0c60397af
commit 86f6c86c4c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
16 changed files with 179 additions and 282 deletions

View file

@ -2,24 +2,11 @@
namespace Helpers;
class Error {
const list = [
'api' => [
'code' => 500,
'message' => 'API unknown error, please check back later'
],
'latte' => [
'code' => 500,
'message' => 'Template render crash, please check back later'
]
];
static public function show(object $meta) {
$http_code = $meta->http_code;
http_response_code($http_code);
static public function show(string $type) {
$keys = array_keys(self::list);
if (in_array($type, $keys)) {
$error = self::list[$type];
http_response_code($error['code']);
$latte = Misc::latte();
$latte->render(Misc::getView('error'), ['type' => $type, 'error' => $error]);
}
$latte = Misc::latte();
$latte->render(Misc::getView('error'), ['error' => $meta]);
}
}