Skip to content

Commit

Permalink
| catch mixpanel error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Yavorsky committed Nov 15, 2023
1 parent 36e9ec8 commit 983d0eb
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions backend/routes/incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def search_incidents():
"""Search Incidents."""
body: SearchIncidentsSchema = request.context.json
query = db.session.query(Incident)
logger = logging.getLogger('incidents')

try:
if body.location:
Expand Down Expand Up @@ -109,12 +110,15 @@ def search_incidents():
page=body.page, per_page=body.perPage, max_per_page=100
)

track_to_mp(request, "search_incidents", {
"description": body.description,
"location": body.location,
"dateStart": body.dateStart,
"dateEnd": body.dateEnd,
})
try:
track_to_mp(request, "search_incidents", {
"description": body.description,
"location": body.location,
"dateStart": body.dateStart,
"dateEnd": body.dateEnd,
})
except MixpanelException as e:
logger.error(e);

try:
return {
Expand Down

0 comments on commit 983d0eb

Please sign in to comment.