Skip to content

Can we convert this in to ServerResponseError.from_response exception instead of NonXMLResponseError #1472

Closed

Description

@hprasad-tls

It would be helpful if ServerResponseError.from_response is implemented on line 173 instead NonXMLResponseError.

raise NonXMLResponseError(server_response.content)

Activity

  1. jorwoods commented on Sep 22, 2024

    @jorwoods
    Contributor

    Can you expand on what you're trying to do and why you think that would be helpful? ServerResponseError is for interpreting errors from a Tableau Server, and parsing that XML into a more descriptive error. If you're getting a NonXMLResponseError then a ServerResponseError.from_response would also not be able to process the content returned. If you're just trying to catch the error, you probably want to go one level up in the exception hierarchy.

    from tableauserverclient.server.endpoint.exceptions import TableauError
  2. hprasad-tls commented on Sep 23, 2024

    @hprasad-tls
    Author

    It's improves the readability and parsing of information, as ServerResponseError.

  3. jorwoods commented on Sep 23, 2024

    @jorwoods
    Contributor

    The issue is if the server doesn't return XML, it can't be parsed into a ServerResponseError. Hence: NonXMLResponseError.

  4. hprasad-tls commented on Sep 23, 2024

    @hprasad-tls
    Author

    but I have seen it responding xml response but data is not parsed.

  5. jorwoods commented on Sep 23, 2024

    @jorwoods
    Contributor

    Can you post a reproducible example of what you are trying when you get the error, as well as the error message returned?

  6. hprasad-tls commented on Sep 23, 2024

    @hprasad-tls
    Author

    This is happening when personal token is wrong and Server authentication failed to Sign in.

  7. hprasad-tls commented on Sep 23, 2024

    @hprasad-tls
    Author

    As you can see in this, it's a XML response the exception is raised because of wrong token.
    image

  8. added 4 commits that reference this issue on Sep 28, 2024
    03fc70b
    878e813
    74f7797
    c6d74e7
  9. added a commit that references this issue on Oct 10, 2024
    b49eac5
  10. added a commit that references this issue on May 5, 2026
    b18d0c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions