[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()
print(f"Hook type: {hook_type}") print(f"Hook type: {hook_type}")
try:
# https://developer.github.com/v3/activity/events/types/#pushevent # https://developer.github.com/v3/activity/events/types/#pushevent
if hook_type == "push": if hook_type == "push":
repository = request.json["repository"]["name"] repository = request.json["repository"]["name"]
@ -305,6 +306,12 @@ async def github(request):
return text("ok") 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("/") @app.route("/")
async def index(request): async def index(request):