Updated Branches: refs/heads/master 30e9a19f6 -> c7ed7b26c
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/c7ed7b26 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c7ed7b26 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c7ed7b26 Branch: refs/heads/master Commit: c7ed7b26cf74e2b7b0071bd6518a2975d8974803 Parents: 30e9a19 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:50:04 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/c7ed7b26/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 d2f8ec4..9177fce 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java @@ -1650,13 +1650,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;
