异常:Mongoid::Errors::CreateCollectionFailure

继承:
MongoidError
  • 对象
显示全部
定义于:
lib/mongoid/errors/create_collection_failure.rb

Overview

尝试创建集合失败时触发。

常量摘要

MongoidError继承的常量

MongoidError::BASE_KEY

实例属性摘要

MongoidError继承的属性

#问题#分辨率#summary

实例方法摘要折叠

MongoidError继承的方法

#compose_message

构造函数详情

#initialize (collection_name, collection_options, error) ⇒ CreateCollectionFailure

此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。

实例化创建集合错误。

参数:

  • collection_name ( string )

    Mongoid 创建失败的集合的名称。

  • collection_options (哈希)

    尝试创建集合时使用的选项。

  • 错误 ( Mongo::Error::OperationFailure )

    尝试创建集合时引发的错误。



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mongoid/errors/create_collection_failure.rb', line 20

def 初始化(collection_name, collection_options, 错误)
  (
      compose_message(
          " create_collection_failure ",
          {
            collection_name: collection_name,
            collection_options: collection_options,
            错误: " #{ error . class } : #{ error . message } "
          }
      )
  )
end