nbuilding/N-lang

request throws a runtime error when the url is invalid

Ashvin-Ranjan opened this issue · 0 comments

Traceback (most recent call last):
  File "C:\Users\Ashvin\N\python\function.py", line 47, in run_command
    _, value = await scope.eval_command(self.codeblock)
  File "C:\Users\Ashvin\N\python\scope.py", line 1154, in eval_command
    exit, value = await self.eval_command(instruction)
  File "C:\Users\Ashvin\N\python\scope.py", line 1319, in eval_command
    expr = await self.eval_expr(assert_type.children[0])
  File "C:\Users\Ashvin\N\python\scope.py", line 922, in eval_expr
    return await self.eval_expr(left) == await self.eval_expr(right)
  File "C:\Users\Ashvin\N\python\scope.py", line 1112, in eval_expr
    return await command.eval()
  File "C:\Users\Ashvin\N\python\ncmd.py", line 45, in eval
    return await maybe_awaitable
  File "C:\Users\Ashvin\N\python\libraries\request.py", line 20, in get
    async with session.get(url, headers=headers) as r:
  File "C:\Users\Ashvin\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "C:\Users\Ashvin\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client.py", line 492, in _request
    req = self._request_class(
  File "C:\Users\Ashvin\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client_reqrep.py", line 305, in __init__
    self.update_host(url)
  File "C:\Users\Ashvin\AppData\Local\Programs\Python\Python39\lib\site-packages\aiohttp\client_reqrep.py", line 366, in update_host
    raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: definitely%20invalid%20url