Add descriptive message for MessagingExceptions.
We can print this message in EventuallyConsistentMapImpl rather than printing
a stack trace which doesn't add any value because the exception always comes
from the same place.
Change-Id: Ia233e7ae8605b2b59ffd4ef834209fdaa86e9376
diff --git a/core/api/src/main/java/org/onosproject/store/cluster/messaging/MessagingException.java b/core/api/src/main/java/org/onosproject/store/cluster/messaging/MessagingException.java
index ce47258..d0b8cbb 100644
--- a/core/api/src/main/java/org/onosproject/store/cluster/messaging/MessagingException.java
+++ b/core/api/src/main/java/org/onosproject/store/cluster/messaging/MessagingException.java
@@ -42,17 +42,26 @@
* Exception indicating no remote registered remote handler.
*/
public static class NoRemoteHandler extends MessagingException {
+ public NoRemoteHandler() {
+ super("No remote message handler registered for this message");
+ }
}
/**
* Exception indicating handler failure.
*/
public static class RemoteHandlerFailure extends MessagingException {
+ public RemoteHandlerFailure() {
+ super("Remote handler failed to handle message");
+ }
}
/**
- * Exception indicating failure due to invalid message strucuture such as an incorrect preamble.
+ * Exception indicating failure due to invalid message structure such as an incorrect preamble.
*/
- public static class ProcotolException extends MessagingException {
+ public static class ProtocolException extends MessagingException {
+ public ProtocolException() {
+ super("Failed to process message due to invalid message structure");
+ }
}
-}
\ No newline at end of file
+}