webhooks: fix unpack order

- run: add warn calls for expected errors
This commit is contained in:
Luna 2019-03-18 17:50:59 -03:00
parent 012567c9d2
commit 8c43bdcee7
2 changed files with 3 additions and 1 deletions

View File

@ -222,7 +222,7 @@ async def _update_webhook(webhook_id: int, j: dict):
@bp.route('/webhooks/<int:webhook_id>', methods=['PATCH']) @bp.route('/webhooks/<int:webhook_id>', methods=['PATCH'])
async def modify_webhook(webhook_id: int): async def modify_webhook(webhook_id: int):
"""Patch a webhook.""" """Patch a webhook."""
guild_id, _user_id = await _webhook_check_fw(webhook_id) _user_id, guild_id = await _webhook_check_fw(webhook_id)
j = validate(await request.get_json(), WEBHOOK_UPDATE) j = validate(await request.get_json(), WEBHOOK_UPDATE)
if 'channel_id' in j: if 'channel_id' in j:

2
run.py
View File

@ -373,6 +373,8 @@ async def handle_litecord_err(err):
except AttributeError: except AttributeError:
pass pass
log.warning('error: {} {!r}', err.status_code, err.message)
return jsonify({ return jsonify({
'error': True, 'error': True,
'status': err.status_code, 'status': err.status_code,