[enh] notify when an exception occured

This commit is contained in:
Laurent Peuch 2019-02-06 13:56:49 +01:00
parent 2b2cf5c308
commit 10a171fbfb

View file

@ -53,6 +53,7 @@ async def github(request):
print()
print(f"Hook type: {hook_type}")
try:
# https://developer.github.com/v3/activity/events/types/#pushevent
if hook_type == "push":
repository = request.json["repository"]["name"]
@ -305,6 +306,12 @@ async def github(request):
return text("ok")
except Exception as e:
import traceback
traceback.print_exc()
notify(f"Error in Webhooks: exception {e} on {hook_type} webhooks, please see logs")
abort(500)
@app.route("/")
async def index(request):