chore: return 422 on slack step not found (#4810)

# What this PR does
Return 422 instead of 500 when the handler for the slack incoming event
was not found to gracefully omit events on call not subscribed to.
This commit is contained in:
Innokentii Konstantinov 2024-08-13 15:57:17 +08:00 committed by GitHub
parent 503939783f
commit b3119e5266
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -433,8 +433,8 @@ class SlackEventApiEndpointView(APIView):
step_was_found = True
if not step_was_found:
raise Exception("Step is undefined" + str(payload))
logger.warning("SlackEventApiEndpointView: Step is undefined" + str(payload))
return Response(status=422)
return Response(status=200)
@staticmethod