Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(webhooks): record the crash the PR-webhook 200 was hiding

Juan Denis118f90790e21
diff --git a/backend/app/api/webhooks.py b/backend/app/api/webhooks.py
index 15e9dcb9..24f45ce7 100644
--- a/backend/app/api/webhooks.py
+++ b/backend/app/api/webhooks.py
@@ -167,8 +167,12 @@ def receive_pull_request(token):
if not getattr(settings, 'enabled', False):
return jsonify({'success': True, 'action': 'ignored',
'reason': 'previews disabled for app'}), 200
- except Exception as exc:
- logger.debug('preview settings lookup failed: %s', exc)
+ except Exception as exc: # noqa: BLE001 - reported below, answered in-band
+ # A failing inbound hook gets disabled by the git provider, so the
+ # answer must stay 200 — but the crash still goes on the record
+ # instead of hiding in a debug log.
+ from app.error_reporting import record_unexpected
+ record_unexpected(exc)
return jsonify({'success': True, 'action': 'ignored',
'reason': 'previews unavailable'}), 200