Exception: Mongo::Error::MaxBSONSize
- Inherits:
-
Mongo::Error
- Object
- StandardError
- Mongo::Error
- Mongo::Error::MaxBSONSize
- Defined in:
- lib/mongo/error/max_bson_size.rb
Overview
Exception that is raised when trying to serialize a document that exceeds max BSON object size.
Constant Summary collapse
- MESSAGE =
The message is constant.
"Document exceeds allowed max BSON size.".freeze
Constants inherited from Mongo::Error
BAD_VALUE, CODE, ERR, ERRMSG, ERROR, UNKNOWN_ERROR, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS
Instance Method Summary collapse
-
#initialize(max_size = nil) ⇒ MaxBSONSize
constructor
Instantiate the new exception.
Constructor Details
#initialize(max_size = nil) ⇒ MaxBSONSize
Instantiate the new exception.
35 36 37 |
# File 'lib/mongo/error/max_bson_size.rb', line 35 def initialize(max_size = nil) super(max_size ? MESSAGE + " The max is #{max_size}." : MESSAGE) end |