Traceback (most recent call last):


 "robbie/sql/postgresql/utils.py", line 119, in robbie.sql.postgresql.utils.sql_exceptions_handler.wrapper


 "robbie/sql/postgresql/client.py", line 119, in fetch


 "/usr/local/lib/python3.6/site-packages/asyncpg/pool.py", line 405, in fetch

return await con.fetch(query, *args, timeout=timeout)


 "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 345, in fetch

return await self._execute(query, args, 0, timeout)


 "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1289, in _execute

query, args, limit, timeout, return_status=return_status)


 "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1297, in __execute

return await self._do_execute(query, executor, timeout)


 "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 1312, in _do_execute

stmt = await self._get_statement(query, timeout)


 "/usr/local/lib/python3.6/site-packages/asyncpg/connection.py", line 286, in _get_statement

statement = await self._protocol.prepare(stmt_name, query, timeout)


 "asyncpg/protocol/protocol.pyx", line 168, in prepare


 "asyncpg/protocol/coreproto.pyx", line 122, in asyncpg.protocol.protocol.CoreProtocol._read_server_messages


 "asyncpg/protocol/coreproto.pyx", line 625, in asyncpg.protocol.protocol.CoreProtocol._push_result


 "asyncpg/protocol/protocol.pyx", line 818, in asyncpg.protocol.protocol.BaseProtocol._on_result


 "asyncpg/protocol/protocol.pyx", line 745, in asyncpg.protocol.protocol.BaseProtocol._dispatch_result
AttributeError: 'NoneType' object has no attribute 'cancelled'

Traceback (most recent call last):


 "lendingbot.py", line 80, in <module>

Lending.cancel_all()


 "/media/kamrenov/other/work/poloniexlendingbot/modules/Lending.py", line 181, in cancel_all

loan_offers = api.return_open_loan_offers()


 "/media/kamrenov/other/work/poloniexlendingbot/modules/Poloniex.py", line 181, in return_open_loan_offers

loan_offers = self.api_query('returnOpenLoanOffers')


 "/media/kamrenov/other/work/poloniexlendingbot/modules/Poloniex.py", line 36, in new_method

return method(self, *arg, **kws)


 "/media/kamrenov/other/work/poloniexlendingbot/modules/Poloniex.py", line 127, in api_query

if ex.code == 502 or ex.code in range(520, 526, 1):
AttributeError: 'exceptions.ValueError' object has no attribute 'code'
