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

a custom checked exception is wrapped as OperationException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.5
    • Fix Version/s: 8.6.0
    • Component/s: None
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.0 S2

      Description

      Steps to Reproduce

      1. configure erro-page in web.xml to catch a specific exception
        	<error-page>
        		<exception-type>support.error.MyCheckedException</exception-type>
        		<location>/error.zul</location>
        	</error-page>
        
      2. throw a checked exception that impelments Expectable (like attached MyCheckedException.java) in a zul like:
        <zk>
        <zscript><![CDATA[
        throw new support.error.MyCheckedException();
        ]]></zscript>
        </zk>
        

      Current Result

      it's wrapped as OperationException, so users can't handle it directly by its class name. it doesn't redirect to error.zul

      Expected Result

      redirect to error.zul

      Debug Info

        Issue Links

          Activity

          Hide
          rudyhuang rudyhuang added a comment -

          Even not being wrapped, not all the checked exceptions can be handled by Servlet directly.
          https://examples.javacodegeeks.com/enterprise-java/servlet/java-servlet-exception-handling-example/

          Accept list:

          • Unchecked Exceptions i.e. java.lang.RuntimeException, Error, and subclasses
          • javax.servlet.ServletException or subclasses
          • java.io.IOException or subclasses
            Note: All other exceptions should be wrapped in javax.servlet.ServletException.

          I'll add this restriction to the document.

          Show
          rudyhuang rudyhuang added a comment - Even not being wrapped, not all the checked exceptions can be handled by Servlet directly. https://examples.javacodegeeks.com/enterprise-java/servlet/java-servlet-exception-handling-example/ Accept list: Unchecked Exceptions i.e. java.lang.RuntimeException, Error, and subclasses javax.servlet.ServletException or subclasses java.io.IOException or subclasses Note: All other exceptions should be wrapped in javax.servlet.ServletException. I'll add this restriction to the document.
          Show
          hawk hawk added a comment - https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Patterns/Error_Handling#Handling_a_Custom_Exception
          Hide
          JamesChu JamesChu added a comment -

          Fixed since 2018/09/14

          Show
          JamesChu JamesChu added a comment - Fixed since 2018/09/14

            People

            • Assignee:
              rudyhuang rudyhuang
              Reporter:
              hawk hawk
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - 4 hours Remaining Estimate - 4 hours
                4h

                  Agile