feat: log plugin runtime errors

This commit is contained in:
Marek Miklewicz
2026-06-02 22:57:23 +02:00
parent 7561077eee
commit 86eb1dddbd
8 changed files with 110 additions and 12 deletions
+1
View File
@@ -16,6 +16,7 @@ return static function (AppContext $ctx): void {
$ctx->audit->record('delete', $ctx->daUser->username(), ['rule_id' => $id, 'subject_prefix' => (string)($rule['subject_prefix'] ?? $rule['subject'] ?? '')]);
Http::redirect($ctx->url('index.html', ['status' => 'deleted']));
} catch (Throwable $e) {
PluginLogger::exception($e, 'DELETE');
$ctx->render('Confirm deletion', '<div class="alert alert-err">' . AppContext::e($e->getMessage()) . '</div>');
return;
}