Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4199

Improve AU response parse error message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • 8.6.0.1
    • ZK Client Engine
    • Security Level: Jimmy
    • None
    • ZK 8.6.2 S1

      Steps to Reproduce

      security configurations often respond per default with a 302 when login is needed (e.g. after a session timeout)

      If a redirect happens on a request to "/zkau" an HTML document is often responded. As a result the user is presented with a technical error message. Even seasoned developers struggle to understand the meaning of these often cryptic error messages - often wasting time with unnecessary debugging.

      e.g.:
      http://forum.zkoss.org/question/101228/better-error-message-when-zkau-response-isnt-json/
      or
      https://stackoverflow.com/questions/54159918/zk-grails-and-spring-security-integration/54301291#54301291

      Current Result

      e.g.:
      "The server is temporarity out of service Would you like try again? (Unexpected token <(SyntaxError)) "

      Expected Result

      A more meaningful error message:
      The Response could not be parsed: Expected format JSON (please check console for details)

      Then print some information into the console e.g. the starting 100chars of the invalid response. And a link to a wiki page with common causes for this (most likely incorrect security redirect configuration).

      Debug Info

      This is often related with security config (often SSO integration) ... ZK-4175 was posted to provide a more reliable redirect handling. However similar parse errors can occur

      Also setting/testing response headers can help to identify the content type of the response, if not ZK's expected format.

            DevChu DevChu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: