From 30c82d69c0a8e1fb6bfa6e69d1601f1046291df4 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 30 Jan 2023 09:15:42 +0100 Subject: [PATCH] Commit --- public/index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index 8fae0d4..5920c75 100644 --- a/public/index.php +++ b/public/index.php @@ -23,9 +23,10 @@ function config(string $key): bool|string|int|float { } foreach (require $config_override_path as $override_key => $override_value) { if (!array_key_exists($override_key, $config)) { - throw new Exception('Undefined key in config override file'); + trigger_error('Undefined key in config file', E_USER_ERROR); } if (gettype($override_value) !== gettype($config[$override_key])) { + trigger_error('Type mismatch in config file', E_USER_ERROR); throw new Exception('Type mismatch in config override file'); } $config[$override_key] = $override_value; @@ -56,7 +57,7 @@ function json_response(mixed $data, int $status_code = 200) /** * Helper for reading and decoding JSON from request body */ -function json_decode_input(): array +function json_decode_input(): array|bool|null { return json_decode(file_get_contents('php://input'), true); }