Skip to content

Commit

Permalink
Merge pull request #398 from Gary-Community-Ventures/feat/webhook_imp…
Browse files Browse the repository at this point in the history
…rovements

Add Logging if Web Hook Fails
  • Loading branch information
CalebPena authored Jun 6, 2024
2 parents 812d2f3 + fd73db1 commit 093827f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benefits/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
CSRF_FAILURE_VIEW = "benefits.views.catch_403_view"

SWAGGER_SETTINGS = {"SUPPORTED_SUBMIT_METHODS": ("get",)}
SWAGGER_SETTINGS = {"SUPPORTED_SUBMIT_METHODS": ("get",), "DEEP_LINKING": True}

# Enable logging with Sentry if it is enabled
if config("SENTRY_DSN", None) is not None:
Expand Down
6 changes: 3 additions & 3 deletions screener/webhooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .models import Screen
from programs.models import Referrer
from .serializers import ScreenSerializer
from sentry_sdk import capture_exception
import requests


Expand All @@ -22,9 +23,8 @@ def send(self, screen: Screen, results: dict):

try:
requests.post(self.hook.webhook_url, json=request_data)
except requests.exceptions.RequestException:
# TODO: add logging
pass
except requests.exceptions.RequestException as e:
capture_exception(e)

def screen_data(self, screen: Screen):
screen_dict = ScreenSerializer(screen).data
Expand Down

0 comments on commit 093827f

Please sign in to comment.