class Mongo::Error::UnexpectedChunkLength

Raised if the next chunk when reading from a GridFSBucket does not have the expected length.

@since 2.1.0

Public Class Methods

new(expected_len, chunk) click to toggle source

Create the new exception.

@example Create the new exception.

Mongo::Error::UnexpectedChunkLength.new(expected_len, chunk)

@param [ Integer ] expected_len The expected length. @param [ Grid::File::Chunk ] chunk The chunk read from GridFS.

@since 2.1.0

Calls superclass method Mongo::Error::new
# File lib/mongo/error/unexpected_chunk_length.rb, line 33
def initialize(expected_len, chunk)
  super("Unexpected chunk length. Chunk has length #{chunk.data.data.size} but expected length " +
    "#{expected_len} or for it to be the last chunk in the sequence.")
end