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 in injectionresponseparser.py #5

Open
xbln opened this issue Aug 24, 2021 · 3 comments
Open

Error in injectionresponseparser.py #5

xbln opened this issue Aug 24, 2021 · 3 comments

Comments

@xbln
Copy link

xbln commented Aug 24, 2021

On unsuccessful injections (e.g. connection error or wrong API-key) a TypeError occurs in that module:

Traceback (most recent call last): File "/usr/scripts/basic.py", line 31, in <module> response = client.send(message) File "/home/pi/.local/lib/python3.7/site-packages/socketlabs/injectionapi/socketlabsclient.py", line 104, in send return self.__send_basic_message(message) File "/home/pi/.local/lib/python3.7/site-packages/socketlabs/injectionapi/socketlabsclient.py", line 130, in __send_basic_message result = InjectionResponseParser.parse(data, response_code) File "/home/pi/.local/lib/python3.7/site-packages/socketlabs/injectionapi/core/injectionresponseparser.py", line 92, in parse injection_response = get_injection_response_dto(response) File "/home/pi/.local/lib/python3.7/site-packages/socketlabs/injectionapi/core/injectionresponseparser.py", line 63, in get_injection_response_dto for item in dct['MessageResults']: TypeError: 'NoneType' object is not iterable

You can test it with your basic send example.

@modaopokimi
Copy link

@xbln Replace 10000 with your server id
client = SocketLabsClient(10000, "YOUR-API-KEY");

@xbln
Copy link
Author

xbln commented Feb 5, 2022

I don´t get your point. I reported a type error on unsuccessful injections. Did you fix that?

@modaopokimi
Copy link

Make sure you add your server-id

client = SocketLabsClient("SERVER_ID", "YOUR-API-KEY");

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