Skip to content
This repository was archived by the owner on Aug 19, 2018. It is now read-only.

Commit d2a1c1c

Browse files
committed
nameerror if invlaid tag
1 parent 594f8ac commit d2a1c1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crasync/core.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ async def get_profile(self, *tags):
3434
else:
3535
raise ConnectionError(f'API not responding: {resp.status}')
3636

37-
if "error" in data:
38-
return None
37+
if 'error' in data:
38+
raise NameError('Invalid Tag')
3939

4040
if isinstance(data, list):
4141
return [Profile(self, c) for c in data]
@@ -47,7 +47,7 @@ async def get_clan(self, *tags):
4747

4848
if ', ' in tags:
4949
raise SyntaxError("Read the docs please")
50-
50+
5151
tags = ','.join(tags)
5252

5353
url = f'{self.BASE}/clan/{tags}'
@@ -58,8 +58,8 @@ async def get_clan(self, *tags):
5858
else:
5959
raise ConnectionError(f'API not responding: {resp.status}')
6060

61-
if "error" in data:
62-
return None
61+
if 'error' in data:
62+
raise NameError('Invalid Tag')
6363

6464
if isinstance(data, list):
6565
return [Clan(self, c) for c in data]

0 commit comments

Comments
 (0)