123456789_123456789_123456789_123456789_123456789_

Exception: Mongoid::Errors::InMemoryRegexpTimeout

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, MongoidError, StandardError
Instance Chain:
self, MongoidError, StandardError
Inherits: Mongoid::Errors::MongoidError
Defined in: lib/mongoid/errors/in_memory_regexp_timeout.rb

Overview

This error is raised when evaluating a query in memory exceeds ::Mongoid::Config.in_memory_regexp_time_limit.

What the limit bounds depends on the Ruby in use. Where per-Regexp timeouts are available it is the time spent executing regular expressions; elsewhere it is the elapsed time of the whole in-memory evaluation. The message is worded to hold either way.

Constant Summary

MongoidError - Inherited

BASE_KEY

Class Method Summary

Instance Attribute Summary

Instance Method Summary

MongoidError - Inherited

#compose_message

Compose the message.

#translate

Given the key of the specific error and the options hash, translate the message.

#translate_problem

Create the problem.

#translate_resolution

Create the resolution.

#translate_summary

Create the summary.

Constructor Details

.new(limit) ⇒ InMemoryRegexpTimeout

Create the new error.

Examples:

Create the new in-memory regexp timeout error.

InMemoryRegexpTimeout.new(5.0)

Parameters:

  • limit (Float) —

    The limit that was exceeded, in seconds. Not always the configured one: a global ::Regexp.timeout stricter than the configuration takes its place.

[ GitHub ]

  
# File 'lib/mongoid/errors/in_memory_regexp_timeout.rb', line 21

def initialize(limit)
  super(compose_message('in_memory_regexp_timeout', limit: limit))
end