WICKET-6600 log with warn only

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/426de327
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/426de327
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/426de327

Branch: refs/heads/WICKET-6563
Commit: 426de327662d5fe879a60aca3e919bb3ca66f8d6
Parents: bd4c0c7
Author: Sven Meier <svenme...@apache.org>
Authored: Mon Nov 5 12:41:36 2018 +0100
Committer: Sven Meier <svenme...@apache.org>
Committed: Mon Nov 5 13:01:32 2018 +0100

----------------------------------------------------------------------
 .../apache/wicket/page/PartialPageUpdate.java   | 27 ++++++++------------
 1 file changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/426de327/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java 
b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
index 0b89cef..5b8794b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
+++ b/wicket-core/src/main/java/org/apache/wicket/page/PartialPageUpdate.java
@@ -439,22 +439,17 @@ public abstract class PartialPageUpdate
                else
                {
                        Page pageOfComponent = component.findParent(Page.class);
-                       if (pageOfComponent != page)
+                       if (pageOfComponent == null) 
                        {
-                               String msg = "Cannot update component because 
its page is not the same as this partial update. Component: " + 
component.toString();
-                               IllegalArgumentException error = new 
IllegalArgumentException(msg);
-
-                               if (pageOfComponent == null) {
-                                       // no longer on page - log the error 
but don't block the user of the application
-                                       // (which was the behavior in Wicket <= 
7).
-                                       LOG.error(msg, error);
-                                       return;
-                               }
-                               else 
-                               {
-                                       // on another page
-                                       throw error;
-                               }
+                               // no longer on page - log the error but don't 
block the user of the application
+                               // (which was the behavior in Wicket <= 7).
+                               LOG.warn("Component '{}' not cannot be updated 
because it was already removed from page", component);
+                               return;
+                       }
+                       else if (pageOfComponent != page) 
+                       {
+                               // on another page
+                               throw new IllegalArgumentException("Component " 
+ component.toString() + " cannot be updated because it is on another page.");
                        }
 
                        if (component instanceof AbstractRepeater)
@@ -462,7 +457,7 @@ public abstract class PartialPageUpdate
                                throw new IllegalArgumentException(
                                                "Component " +
                                                                
component.getClass().getName() +
-                                                               " has been 
added to a partial page update. This component is a repeater and cannot be 
repainted directly. " +
+                                                               " is a repeater 
and cannot be added to a partial page update directly. " +
                                                                "Instead add 
its parent or another markup container higher in the hierarchy.");
                        }
                }

Reply via email to