code: public <CAUSE extends RuntimeException> void handle(Class<CAUSE> appExType, UserMessages messages,
              HandledAppExResponseCall<CAUSE> causeLambda) {
          assertArgumentNotNull("appExType", appExType);
          assertArgumentNotNull("messages", messages);
          assertArgumentNotNull("causeLambda", causeLambda);
          if (appExType.isAssignableFrom(cause.getClass())) {
              messagesSaver.save(messages);
              @SuppressWarnings("unchecked")
              final CAUSE castCause = (CAUSE) cause; // safety because of in if-isAssignableFrom()
              response = causeLambda.callback(castCause); // not null, undefined allowed
              if (response == null) {
                  throw new IllegalStateException("Cannot return null response from application handling.", cause);
              }
          }
      }
docs: Handle application exception as your rule.
  <pre>
  {@literal @}Override
  <span style="color: #77226C">protected</span> void handleApplicationException(ActionRuntime <span style="color: #553000">runtime</span>, ApplicationExceptionHandler <span style="color: #553000">handler</span>) {
  <span style="color: #77226C">super</span>.handleApplicationException(<span style="color: #553000">handler</span>);
  <span style="color: #553000">handler</span>.<span style="color: #CC4747">handle</span>(EntityAlreadyDeletedException.<span style="color: #77226C">class</span>, createMessages().addErrors...(<span style="color: #0000C0">GLOBAL</span>), <span style="color: #553000">cause</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> {
  <span style="color: #77226C">return</span> asHtml(<span style="color: #0000C0">path_...</span>);
  });
  }
  </pre>
  @param <CAUSE> The type of application exception.
  @param appExType The type of application exception. (NotNull)
  @param messages The user messages for the application exception. (NotNull)
  @param causeLambda The callback to provide action response for the application exception. (NotNull)