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

Error local variable 'ex' referenced before assignment #660

Open
easye35 opened this issue May 9, 2021 · 4 comments
Open

Error local variable 'ex' referenced before assignment #660

easye35 opened this issue May 9, 2021 · 4 comments

Comments

@easye35
Copy link

easye35 commented May 9, 2021

Keep getting this error on the log

Traceback (most recent call last):
poloniex_1 | File "/usr/src/app/lendingbot.py", line 97, in
poloniex_1 | Lending.transfer_balances()
poloniex_1 | File "/usr/src/app/modules/Lending.py", line 454, in transfer_balances
poloniex_1 | exchange_balances = api.return_balances() # This grabs only exchange balances.
poloniex_1 | File "/usr/src/app/modules/Poloniex.py", line 169, in return_balances
poloniex_1 | return self.api_query('returnBalances')
poloniex_1 | File "/usr/src/app/modules/ExchangeApi.py", line 29, in new_method
poloniex_1 | return method(self, *arg, **kws)
poloniex_1 | File "/usr/src/app/modules/Poloniex.py", line 141, in api_query
poloniex_1 | ex.message = ex.message if hasattr(ex, 'message') and ex.message else str(ex)
poloniex_1 | UnboundLocalError: local variable 'ex' referenced before assignment
poloniex_1 |
poloniex_1 | Unhandled error, please open a Github issue so we can fix it!

@easye35
Copy link
Author

easye35 commented May 9, 2021

Traceback (most recent call last):
tindolt_1 | File "lendingbot.py", line 97, in
tindolt_1 | Lending.transfer_balances()
tindolt_1 | File "/usr/src/app/modules/Lending.py", line 454, in transfer_balances
tindolt_1 | exchange_balances = api.return_balances() # This grabs only exchange balances.
tindolt_1 | File "/usr/src/app/modules/Poloniex.py", line 169, in return_balances
tindolt_1 | return self.api_query('returnBalances')
tindolt_1 | File "/usr/src/app/modules/ExchangeApi.py", line 29, in new_method
tindolt_1 | return method(self, *arg, **kws)
tindolt_1 | File "/usr/src/app/modules/Poloniex.py", line 143, in api_query
tindolt_1 | raise ex
tindolt_1 | ValueError: No JSON object could be decoded

@easye35
Copy link
Author

easye35 commented May 9, 2021

Seems that it only happens when Poloniex is giving a 502 error msg

@rnevet
Copy link
Collaborator

rnevet commented May 9, 2021

There should be error handling for error 502, maybe Polo changed something.

@easye35
Copy link
Author

easye35 commented May 9, 2021

I see that section in poloniex.py. But that's where the error coming from. not sure why though, doesn't seem to be handling error. At least that's what it looks like to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants