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

ApiException causes no attribute 'trace_token' exception when trying to print it #177

Open
jmrodri opened this issue Oct 26, 2023 · 1 comment · May be fixed by #178
Open

ApiException causes no attribute 'trace_token' exception when trying to print it #177

jmrodri opened this issue Oct 26, 2023 · 1 comment · May be fixed by #178

Comments

@jmrodri
Copy link

jmrodri commented Oct 26, 2023

The ApiException class has an optional http_resp parameter. It will then use the alternate construction which does not set the trace_token attribute.

Here is a reproducer:

from docusign_esign import ApiException
e = ApiException(status="status", reason="reason")
print(e)

Here is what I got when running it:

In [1]: from docusign_esign import ApiException

In [2]: e = ApiException(status="status", reason="reason")

In [3]: print(e)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-0c8bf275a22d> in <module>
----> 1 print(e)

~/.pyenv/versions/3.8.14-yardline/lib/python3.8/site-packages/docusign_esign/client/api_exception.py in __str__(self)
     38                         "Reason: {1}\n" \
     39                         "Trace-Token: {2}\n" \
---> 40                         "Timestamp: {3}\n".format(self.status, self.reason, self.trace_token, self.timestamp)
     41         if self.headers:
     42             error_message += "HTTP response headers: {0}\n".format(self.headers)

AttributeError: 'ApiException' object has no attribute 'trace_token'
jmrodri added a commit to jmrodri/docusign-esign-python-client that referenced this issue Oct 26, 2023
Fixes docusign#177

Signed-off-by: jesus m. rodriguez <jmrodri@gmail.com>
@jmrodri jmrodri linked a pull request Oct 26, 2023 that will close this issue
@jmrodri
Copy link
Author

jmrodri commented Oct 26, 2023

After the patch it works:

(status)
Reason: reason
Trace-Token: None
Timestamp: None

jmrodri added a commit to jmrodri/docusign-esign-python-client that referenced this issue Jan 20, 2024
Fixes docusign#177

Signed-off-by: jesus m. rodriguez <jmrodri@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant