diff options
| author | Agando <roduccomm@gmail.com> | 2026-07-29 20:46:12 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-07-29 20:46:12 +0200 |
| commit | 19b8da0faccfc4438ed19fbc99d992a6a07af003 (patch) | |
| tree | 8bcc4112a20b57a8b03a360097b20101b75e7b4a /api/debug/error.php | |
| parent | 2538c91876455fe96febf441fc8dde20f2606023 (diff) | |
auto: 2026-07-29_20:50 changes — gunes sponsorluk page, bunq payment modal, AI platforms, news W30
Diffstat (limited to 'api/debug/error.php')
| -rw-r--r-- | api/debug/error.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/api/debug/error.php b/api/debug/error.php new file mode 100644 index 0000000..242dfca --- /dev/null +++ b/api/debug/error.php @@ -0,0 +1,36 @@ +<?php +require_once __DIR__ . '/config.php'; + +$hash = $_GET['hash'] ?? ''; +if (!$hash) error_response('Missing hash parameter'); + +$errors = load_json(ERRORS_FILE); +$sessions = load_json(SESSIONS_FILE); + +$matches = array_filter($errors, fn($e) => ($e['hash'] ?? '') === $hash); +$matches = array_values($matches); + +if (empty($matches)) { + error_response('Error not found', 404); +} + +$totalCount = array_sum(array_column($matches, 'count')); +$uniqueSessions = array_unique(array_column($matches, 'session_id')); +$firstSeen = min(array_column($matches, 'first_seen')); +$lastSeen = max(array_column($matches, 'last_seen')); + +json_response([ + 'success' => true, + 'hash' => $hash, + 'total_occurrences' => count($matches), + 'total_count' => $totalCount, + 'unique_sessions' => count($uniqueSessions), + 'first_seen' => $firstSeen, + 'last_seen' => $lastSeen, + 'type' => $matches[0]['type'] ?? 'unknown', + 'severity' => $matches[0]['severity'] ?? 'error', + 'category' => $matches[0]['category'] ?? 'runtime', + 'sample_message' => $matches[0]['message'] ?? '', + 'sample_stack' => $matches[0]['stack'] ?? null, + 'occurrences' => array_slice($matches, 0, 20), +]); |