summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAutomerge <automerge@vaadin.com>2012-02-14 22:08:42 +0000
committerAutomerge <automerge@vaadin.com>2012-02-14 22:08:42 +0000
commitb495b8f7f4d4cf1ea1731b45d1cf6e35bdd86779 (patch)
treeff6195ac66e44e7cdf625bc98f338395825ad6c3 /src
parentcc4914f4969141fcdc92f636ccb67b84c99f32f7 (diff)
downloadvaadin-framework-b495b8f7f4d4cf1ea1731b45d1cf6e35bdd86779.tar.gz
vaadin-framework-b495b8f7f4d4cf1ea1731b45d1cf6e35bdd86779.zip
[merge from 6.7] #8392 Improved error message for exceptions that take place in listener code
svn changeset:23006/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/event/ListenerMethod.java49
1 files changed, 5 insertions, 44 deletions
diff --git a/src/com/vaadin/event/ListenerMethod.java b/src/com/vaadin/event/ListenerMethod.java
index c11f3b1424..1f1305fa69 100644
--- a/src/com/vaadin/event/ListenerMethod.java
+++ b/src/com/vaadin/event/ListenerMethod.java
@@ -517,8 +517,10 @@ public class ListenerMethod implements EventListener, Serializable {
} catch (final java.lang.reflect.InvocationTargetException e) {
// An exception was thrown by the invocation target. Throw it
// forwards.
- throw new MethodException("Invocation of method " + method
- + " failed.", e.getTargetException());
+ throw new MethodException("Invocation of method "
+ + method.getName() + " in "
+ + target.getClass().getName() + " failed.",
+ e.getTargetException());
}
}
}
@@ -617,49 +619,8 @@ public class ListenerMethod implements EventListener, Serializable {
public class MethodException extends RuntimeException implements
Serializable {
- private final Throwable cause;
-
- private String message;
-
private MethodException(String message, Throwable cause) {
- super(message);
- this.cause = cause;
- }
-
- /**
- * Retrieves the cause of this throwable or <code>null</code> if the
- * cause does not exist or not known.
- *
- * @return the cause of this throwable or <code>null</code> if the cause
- * is nonexistent or unknown.
- * @see java.lang.Throwable#getCause()
- */
- @Override
- public Throwable getCause() {
- return cause;
- }
-
- /**
- * Returns the error message string of this throwable object.
- *
- * @return the error message.
- * @see java.lang.Throwable#getMessage()
- */
- @Override
- public String getMessage() {
- return message;
- }
-
- /**
- * @see java.lang.Throwable#toString()
- */
- @Override
- public String toString() {
- String msg = super.toString();
- if (cause != null) {
- msg += "\nCause: " + cause.toString();
- }
- return msg;
+ super(message, cause);
}
}