8000 You are trying to throw an error that you never even imported · Issue #514 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

You are trying to throw an error that you never even imported #514

New issue

8000 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

Closed
dprophet opened this issue Oct 23, 2019 · 5 comments
Closed

You are trying to throw an error that you never even imported #514

dprophet opened this issue Oct 23, 2019 · 5 comments
Assignees

Comments

@dprophet
Copy link

You are trying to throw an error

NonXMLResponseError

https://github.com/tableau/server-client-python/blob/master/tableauserverclient/server/endpoint/endpoint.py#L73

That you never imported. This totally breaks the debugging for us Corporate users that are behind all kinds of security systems. Please Fix ASAP.

@dprophet
Copy link
Author
dprophet commented Oct 23, 2019

I totally disagree with this NonXMLResponseError error approach. The errors I am experience have to do with low level proxy, firewalls, certificates of authority, and NonXMLResponseError outright masks the error. These errors happen long before any communication has happened with Tableau Server.

Throw the root error, like you did in v0.8.1 and let the application developer make an intelligent choice. The "ServerResponseError.from_response" is a case of a library trying to do to much.

@t8y8
Copy link
Collaborator
t8y8 commented Oct 23, 2019

ServerResponseError will throw a ParseError if we revert this and you get a non-success code HTTP response that doesn't include our error-xml object. The ParseError throws an unhelpful 'couldn't parse at line1'.

Even in 0.8.1, we would just be returning a ParseError.
What information would you like passed through? The HTTP Response Body?

We can make a change here to improve it, but I need more detail on how you think the exception handling should flow. Would you be able to share an idea, either here or as a PR that I can review?

I took a look at the code, and it could be argued that the real issue starts athttps://github.com/tableau/server-client-python/blob/master/tableauserverclient/server/endpoint/exceptions.py#L17 where we blindly assume all response bodies will have an error object

@t8y8 t8y8 self-assigned this Oct 23, 2019
t8y8 added a commit that referenced this issue Oct 24, 2019
Catch ParseError's and pass the response body up though the stack.
Partially addresses #514
@dprophet
Copy link
Author

First thing is first. Fix the import on

https://github.com/tableau/server-client-python/blob/master/tableauserverclient/server/endpoint/endpoint.py#L1

You need to import NonXMLResponseError

@t8y8
Copy link
Collaborator
t8y8 commented Oct 25, 2019

Agreed, I pushed a fix in #515, it's in development now (where you can pull from to verify) -- we're discussing a patch release to master shortly as well.

@bcantoni
Copy link
Contributor

I'm going to close this based on the end of the discussion where Tyler added the fix to import that error properly.

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

3 participants
0