BUG-731: do not throw RuntimeException 15/6715/1
authorRobert Varga <rovarga@cisco.com>
Mon, 5 May 2014 13:19:35 +0000 (15:19 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 5 May 2014 13:19:35 +0000 (15:19 +0200)
Let's turn this into an IllegalArgumentException, with a proper message.

Change-Id: I5bb149de83001ea6817c6f58fb1d5d9be41907e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
util/src/main/java/org/opendaylight/protocol/util/PCEPHexDumpParser.java

index fcb17e079f133420085ca523bce0e094c2cc412a..d7bd9b0429fddd60514dbfcc92b3231c8d8c8e7c 100644 (file)
@@ -25,9 +25,9 @@ import com.google.common.io.CharStreams;
 
 /**
  * Parses PCEP messages from a text file. Messages need to follow this formatting:
- * 
+ *
  * Received PCEP Open message. Length:28.
- * 
+ *
  * 20 01 00 1c 01 10 00 18 20 1e 78 03 00 10 00 04 00 00 00 05 00 1a 00 04 00 00 00 b4
  */
 public final class PCEPHexDumpParser {
@@ -76,7 +76,7 @@ public final class PCEPHexDumpParser {
                        try {
                                message = Hex.decodeHex(hexMessage.toCharArray());
                        } catch (final DecoderException e) {
-                               new RuntimeException(e);
+                               new IllegalArgumentException("Failed to decode message", e);
                        }
                        messages.add(message);
                        idx = messageEndIdx;