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

Better handling of parameters errors #319

Open
lucagiove opened this issue Feb 13, 2021 · 0 comments
Open

Better handling of parameters errors #319

lucagiove opened this issue Feb 13, 2021 · 0 comments
Labels

Comments

@lucagiove
Copy link
Member

Ohhhh there was a missing space before expected_status=any in

Patch On Session blockfilter ${path} json=${data} headers=${headers} expected_status=any

It would be cool to have a better error message than AttributeError: 'str' object has no attribute 'items'

The call stack is below if it can help to have a better message:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/RequestsLibrary/utils.py", line 138, in decorator
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/RequestsLibrary/RequestsOnSessionKeywords.py", line 106, in patch_on_session
    response = self._common_request("patch", session, url,
  File "/usr/local/lib/python3.9/site-packages/RequestsLibrary/SessionKeywords.py", line 569, in _common_request
    resp = method_function(
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 602, in patch
    return self.request('PATCH', url, data=data, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 449, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 315, in prepare
    self.prepare_headers(headers)
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 447, in prepare_headers
    for header in headers.items():

Originally posted by @dprevost-LMI in #314 (comment)

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

No branches or pull requests

1 participant