Let's turn this into an IllegalArgumentException, with a proper message.
Change-Id: I5bb149de83001ea6817c6f58fb1d5d9be41907e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
/**
* 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 {
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;