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

Connection error comes json.decoder.JSONDecodeError: Expecting value: #70

Closed
rasdehya opened this issue Nov 28, 2017 · 4 comments
Closed

Comments

@rasdehya
Copy link

rasdehya commented Nov 28, 2017

Versions

OS: Windows10
Python: 3.6
krakenex: 3.0 2

What are you trying to achieve?

i try to make pubic query over kraken API, but i get a recursive error but it doest come each time.

for asset in my_pair:
            response = k.query_public('Depth', {'pair': asset, 'count': '3'})

What do you expect to happen?

Normally i get the result that i can format

What happens instead?

  File "C:\Users\ras\Python\Python36-32\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It 'seems like a connection problem... I've seen a past issue that had been closed
i get an empty dict from the API ?? is it ?

I'm really new to prog and python, and i struggle with error handling...

I'm suprise i didnt get a time out or something like that, or a 502
Must i deal with try/catch ? someone has a trick for that ?
How could i know wich error to look at ? so i can repeat the query till successful

Sorry if too obvious.... tell me and i will google more

Thanks

@veox
Copy link
Owner

veox commented Nov 28, 2017

The latest version of krakenex is v2.0.0.

The error looks like what you'd get in v0 and v1.

How did you install it?..

EDIT: In v2, exceptions raised due to networking errors should all be requests.exceptions.HTTPError.


Otherwise - correct, it's a connection problem, which you're likely to experience a lot these days with Kraken.

@rasdehya
Copy link
Author

Thanks for reply Veox.
I installed it via pip with python 3.6 in windows 10
And yes V2.0 .... :-)) it was 3.0 of GPL.... hahaha... really new into all that.
EDIT: In v2, exceptions raised due to networking errors should all be requests.exceptions.HTTPError.

Exactly that is what i expected.
But What you say is that i have to try/catch this one in order to succeed ? or should it be raised automaticly by krakenex?...

at the time i write, my script work just fine...no connection pb with kraken

@veox
Copy link
Owner

veox commented Nov 29, 2017

It's very strange that you get that error, if it's really at v2... Could you try this in your script?

print(krakenex.version.__version__)

It might be that you have several versions installed, and the script is picking up a different one than you think.

If it does say '2.0.0' - could you try force-reinstalling?..

I've never used pip on Windows, so can't help much here. On Linux, it'd be something like pip install --upgrade krakenex.

Otherwise, what's in my_pair?..


But What you say is that i have to try/catch this one in order to succeed ? or should it be raised automaticly by krakenex?...

The exception is raised automatically by krakenex on network errors.

Here's a gist with a real-world example of how I'm using try/except in a script to debug an issue (#66)... Perhaps it's too convoluted if you're new to programming, though. :(

@veox veox added the stale label Jan 10, 2018
@veox
Copy link
Owner

veox commented Feb 9, 2018

Closing as stale.

@veox veox closed this as completed Feb 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants