lib/rex/java/serialization/model/block_data_long.rb in rex-2.0.8 vs lib/rex/java/serialization/model/block_data_long.rb in rex-2.0.9

- old
+ new

@@ -24,23 +24,23 @@ # Deserializes a Rex::Java::Serialization::Model::BlockDataLong # # @param io [IO] the io to read from # @return [self] if deserialization succeeds - # @raise [RuntimeError] if deserialization doesn't succeed + # @raise [Rex::Java::Serialization::DecodeError] if deserialization doesn't succeed def decode(io) raw_length = io.read(4) if raw_length.nil? || raw_length.length != 4 - raise ::RuntimeError, 'Failed to unserialize BlockDataLong' + raise Rex::Java::Serialization::DecodeError, 'Failed to unserialize BlockDataLong' end self.length = raw_length.unpack('N')[0] if length == 0 self.contents = '' else self.contents = io.read(length) if contents.nil? || contents.length != length - raise ::RuntimeError, 'Failed to unserialize BlockData' + raise Rex::Java::Serialization::DecodeError, 'Failed to unserialize BlockData' end end self end \ No newline at end of file