Github user martin-g commented on the issue:

    https://github.com/apache/wicket/pull/208
  
    `IllegalStateException` looks good to me. The developer expects that the 
page is in stateless state but it is not!
    What about introducing a custom exception and pass it to the `#fail()` 
method ? By default it will be thrown but the application can override the 
method and log it or do whatever it finds suitable.
    
    `if (!condition) { fail(new CustomException("A good message")) }`
    and 
    ````java
    protected void fail(CustomException cx) {
      throw cx;
    }
    ```
    or 
    ````java
    protected void fail(CustomException cx) {
      LOG.warn("The page is not really stateful: {}", cx.getMessage(), cx);
    }
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to