mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[enh] notify when an exception occured
This commit is contained in:
parent
2b2cf5c308
commit
10a171fbfb
1 changed files with 233 additions and 226 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue