Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-726

Cannot retrieve the HTTP message from HTTPTransportException

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • current (nightly)
    • 1.6 Alpha
    • Basic Architecture
    • None

    Description

      The axis code concatenates its own message text with the text from the HTTP messages . For example, if there is a basic authentication failure, it concatenates "HTTP transport error" with "unauthorized". So, the caller sees the text "HTTP transport error unauthorized". There is no way for the caller to know what the HTTP message was withouth parsing the exception text. The caller can take appropriate action based on the HTTP message. If the HTTP message says "unauthorized" the operation can be aborted. Other wise (server down or some network glitch) the operation can be retried. So, it would be nice if the axis code returns its message text and the HTTP text separately. Maybe there should two "what()" methods, one returning the axis text and the other the HTTP message text.

      This problem might be there for other types of exceptions also.

      Attachments

        Activity

          hawkeye John Hawkins added a comment -

          Sounds like we need some kind of "cause" method that returns the wrappered problem?

          hawkeye John Hawkins added a comment - Sounds like we need some kind of "cause" method that returns the wrappered problem?

          Well we could add another method in addition to 'what()' method to extract the http specific error.
          However, in this case, the user must know that this is a Transport Exception in order to call 'cause' method, as it is does not make sense to have such a method at the base class level in AxisException class. So you will not be able to benefit from plymorphism

          A better alternative would be to classify the sections of the error message such as:

          "Axis Client error: HTTP trasport error
          HTTP error: unauthorized"

          This way we could catch the excpetion using the base class and still be able to see the HTTP specific error.

          Thoughts please...

          samisa Don Samisa Abeysinghe added a comment - Well we could add another method in addition to 'what()' method to extract the http specific error. However, in this case, the user must know that this is a Transport Exception in order to call 'cause' method, as it is does not make sense to have such a method at the base class level in AxisException class. So you will not be able to benefit from plymorphism A better alternative would be to classify the sections of the error message such as: "Axis Client error: HTTP trasport error HTTP error: unauthorized" This way we could catch the excpetion using the base class and still be able to see the HTTP specific error. Thoughts please...

          I changed the HTTP error code handling exception message to send something similr to the following:

          HTTPTransportException:HTTP transport error
          Server sent HTTP error: 'Not Found'

          samisa Don Samisa Abeysinghe added a comment - I changed the HTTP error code handling exception message to send something similr to the following: HTTPTransportException:HTTP transport error Server sent HTTP error: 'Not Found'

          People

            samisa Don Samisa Abeysinghe
            sukumarjira Suresh Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: