Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wikia] setting default domain should have a check to see that it is a URL and not a name #17

Open
kennnyshiwa opened this issue Sep 3, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@kennnyshiwa
Copy link
Contributor

Attempted to use wikiaset to set starwars as the default domain. Then attempted to search for something in this case han solo and broke the cog

Traceback (most recent call last):
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/kstjohn_kstj_us/.local/share/Red-DiscordBot/cogs/CogManager/cogs/wikia/wikia.py", line 26, in wikia
    await self.search_article(ctx, query, domain)
  File "/home/kstjohn_kstj_us/.local/share/Red-DiscordBot/cogs/CogManager/cogs/wikia/wikia.py", line 116, in search_article
    async with session.post(str(domain) + "/api/v1/Search/List?limit=10&batch=1&query=" + article, headers=headers) as response:
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/aiohttp/client.py", line 1005, in __aenter__
    self._resp = await self._coro
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/aiohttp/client.py", line 466, in _request
    ssl=ssl, proxy_headers=proxy_headers, traces=traces)
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 286, in __init__
    self.update_host(url)
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 340, in update_host
    raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: starwars/api/v1/Search/List?limit=10&batch=1&query=Han+Solo

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/kstjohn_kstj_us/venv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: InvalidURL: starwars/api/v1/Search/List?limit=10&batch=1&query=Han+Solo```
@kennnyshiwa
Copy link
Contributor Author

Nevermind, didn't see that the default wikia site needed to be the url not the name, sorry

@lionirdeadman
Copy link
Member

I should probably make something as to avoid this problem so I'll reopen this issue and rename it

@lionirdeadman lionirdeadman reopened this Sep 4, 2019
@lionirdeadman lionirdeadman added the enhancement New feature or request label Sep 4, 2019
@lionirdeadman lionirdeadman changed the title [wikia] setting deafult domain to look at breaks searchs [wikia] setting default domain should have a check to see that it is a URL and not a name Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants