webhooks/github: Provide more detailed info for unexpected events.

Signed-off-by: Hemanth V. Alluri <hdrive1999@gmail.com>
This commit is contained in:
Hemanth V. Alluri 2020-05-12 22:27:30 +05:30 committed by Tim Abbott
parent 88367a129c
commit ab03659095
1 changed files with 2 additions and 1 deletions

View File

@ -569,7 +569,8 @@ def get_event(request: HttpRequest, payload: Dict[str, Any], branches: Optional[
elif event in IGNORED_EVENTS: elif event in IGNORED_EVENTS:
return None return None
raise UnexpectedWebhookEventType('GitHub', event) complete_event = "{}:{}".format(event, payload.get("action", "???")) # nocoverage
raise UnexpectedWebhookEventType('GitHub', complete_event)
def get_body_function_based_on_type(type: str) -> Any: def get_body_function_based_on_type(type: str) -> Any:
return EVENT_FUNCTION_MAPPER.get(type) return EVENT_FUNCTION_MAPPER.get(type)