From 69493e6912637640ab7357b7cf0bf9680be4780f Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 8 Dec 2018 18:42:40 -0300 Subject: [PATCH] relationships: raise RelationshipFailed this only applies to accounts that are not found. related to #30 --- litecord/blueprints/relationships.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litecord/blueprints/relationships.py b/litecord/blueprints/relationships.py index 547ac63..5517254 100644 --- a/litecord/blueprints/relationships.py +++ b/litecord/blueprints/relationships.py @@ -126,6 +126,10 @@ async def make_friend(user_id: int, peer_id: int, return +class RelationshipFailed(BadRequest): + error_code = 80004 + + @bp.route('/@me/relationships', methods=['POST']) async def post_relationship(): user_id = await token_check() @@ -135,7 +139,7 @@ async def post_relationship(): str(j['discriminator'])) if not uid: - return '', 404 + raise RelationshipFailed() res = await make_friend(user_id, uid)