(operation, doc_size, max_size)
Internal helper for raising DocumentTooLarge.
Internal helper for raising DocumentTooLarge.
Internal helper for raising DocumentTooLarge .
def _raise_document_too_large(operation, doc_size, max_size):
    """Internal helper for raising DocumentTooLarge."""
    if operation == "insert":
        raise DocumentTooLarge("BSON document too large (%d bytes)"
                               " - the connected server supports"
                               " BSON document sizes up to %d"
                               " bytes." % (doc_size, max_size))
    else:
        # There's nothing intelligent we can say
        # about size for update and remove
        raise DocumentTooLarge("command document too large")
def _raise_document_too_large ( operation , doc_size , max_size ) : if operation == "insert" : raise DocumentTooLarge ( "BSON document too large (%d bytes)" " - the connected server supports" " BSON document sizes up to %d" " bytes." % ( doc_size , max_size ) ) else : # There's nothing intelligent we can say # about size for update and remove raise DocumentTooLarge ( "command document too large" )