mail send debug

This commit is contained in:
2026-08-08 23:17:17 +03:00
parent 3e01f4b391
commit 28fc484c9f
3 changed files with 102 additions and 24 deletions
+3
View File
@@ -5,11 +5,14 @@
declare(strict_types=1);
$config = require __DIR__ . '/config.php';
require_once __DIR__ . '/_debug.php';
// Never leak PHP errors into the response; any uncaught throwable becomes a JSON 500.
ini_set('display_errors', '0');
set_exception_handler(function (Throwable $e): void {
error_log('[casadoc-api] ' . $e);
// TEMPORARY.
debug_log('[' . ($_SERVER['REQUEST_URI'] ?? '?') . '] uncaught: ' . $e);
if (!headers_sent()) {
http_response_code(500);
header('Content-Type: application/json; charset=utf-8');