Updated Branches: refs/heads/wicket-1.5.x aeb6f244a -> 7ed9335c8
Do not log the exception when getting the default model's object fails. Wrap it in another exception to bring the info about the current component but do not log it. Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/7ed9335c Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/7ed9335c Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/7ed9335c Branch: refs/heads/wicket-1.5.x Commit: 7ed9335c8513b511d4bb2b0d045b925f48ee1505 Parents: aeb6f24 Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Fri Jan 27 14:43:46 2012 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Fri Jan 27 14:47:48 2012 +0200 ---------------------------------------------------------------------- .../src/main/java/org/apache/wicket/Component.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/7ed9335c/wicket-core/src/main/java/org/apache/wicket/Component.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java b/wicket-core/src/main/java/org/apache/wicket/Component.java index 21ade17..648ed95 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -1655,13 +1655,12 @@ public abstract class Component // Get model value for this component. return model.getObject(); } - catch (RuntimeException ex) + catch (Exception ex) { - log.error( - "Error while getting default model object for Component: " + + // wrap the exception so that it brings info about the component + RuntimeException rex = new RuntimeException("An error occurred while getting the model object for Component: " + this.toString(true), ex); - - throw ex; + throw rex; } } return null;
