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

exception-type configuration doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 8.0.0
    • Fix Version/s: None
    • Component/s: Configuration
    • Labels:

      Description

      Example:

      <error-page>
      <exception-type>com.text.CustomException</exception-type>
      <location>/errorpagebug.zul</location>
      </error-page>

      From the The error-page Element page (http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_error-page_Element):

      It specifies an error page used when an un-caught exception is thrown in updating a ZUML page (e.g., in an event listener). Each page is associated with an exception type, aka, a class deriving from java.lang.Throwable. You can specify multiple error pages, each with a different exception type. When an error occurs, ZK searches the proper error page by examing the exception type one-by-one. If none is found, it will show an alert message at the client by default.

      That is not hapening. The CustomException reaches the UiEngineImpl.visualizeErrors method as wrapped in either UiException or OperationException (when the custom exception implements Expectable). The call to Configuration.getErrorPage fails because the CustomException is neither a instance of UiException nor OperationException.

      The only way I was able to make the error-page configuration work was by using java.lang.Throwable as the execution type.

        Attachments

        1. CustomException.java
          0.2 kB
        2. error.zul
          0.3 kB
        3. errorpagebug.zul
          0.1 kB
        4. ErrorPageBugVM.java
          0.2 kB
        5. ErrorVM.java
          1 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            famls famls
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: