Give the PHP layer somewhere to record what it swallowed
This commit is contained in:
@@ -170,7 +170,7 @@ if (is_dir(LOG_DIR)) {
|
||||
if ($lastErr !== null)
|
||||
$errors[] = ['script' => $script, 'line' => $lastErr, 'ts' => (int)$lf->getMTime()];
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
} catch (Exception $e) { vv_log_error('api/board.php', 'log walk failed: ' . $e->getMessage()); }
|
||||
usort($errors, fn($a, $b) => $b['ts'] - $a['ts']);
|
||||
}
|
||||
$out['errors'] = array_slice($errors, 0, 20);
|
||||
|
||||
@@ -76,7 +76,7 @@ try {
|
||||
'dur' => isset($d['end']) ? max(0, (int)$d['end'] - (int)$d['start']) : 0,
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
} catch (Exception $e) { vv_log_error('api/recent.php', 'run-log walk failed: ' . $e->getMessage()); }
|
||||
|
||||
usort($runs, fn($a, $b) => $b['start'] - $a['start']);
|
||||
echo json_encode(['ok' => true, 'runs' => array_slice($runs, 0, 24)]);
|
||||
|
||||
@@ -123,7 +123,7 @@ if ($action === 'list_scripts') {
|
||||
$label = str_replace('_', ' ', basename($rel, '.sh'));
|
||||
$groups[$folder][] = ['id' => $rel, 'label' => $label];
|
||||
}
|
||||
} catch (Exception $e) {}
|
||||
} catch (Exception $e) { vv_log_error('api/rsync_win_arrays.php', 'script tree walk failed: ' . $e->getMessage()); }
|
||||
ksort($groups);
|
||||
foreach ($groups as &$g) usort($g, fn($a, $b) => strcmp($a['id'], $b['id']));
|
||||
echo json_encode(['ok' => true, 'groups' => $groups]);
|
||||
|
||||
Reference in New Issue
Block a user