mongodb/mongoid · error · Mongoid::Errors::Callback

Calling %{method} on %{klass} resulted in a false return fro

Error message

Calling %{method} on %{klass} resulted in a false return from a callback.

What it means

Error "Calling %{method} on %{klass} resulted in a false return from a callback." thrown in mongodb/mongoid.

Source

Thrown at lib/mongoid/persistable.rb:142

    #
    # @example Raise the validation error.
    #   Person.fail_due_to_validation!(person)
    #
    # @raise [ Errors::Validations ] The validation error.
    def fail_due_to_validation!
      raise Errors::Validations.new(self)
    end

    # Raise an error if a callback failed.
    #
    # @example Raise the callback error.
    #   Person.fail_due_to_callback!(person, :create!)
    #
    # @param [ Symbol ] method The method being called.
    #
    # @raise [ Errors::Callback ] The callback error.
    def fail_due_to_callback!(method)
      raise Errors::Callback.new(self.class, method)
    end

    private

    # Are we executing an atomically block on the current document?
    #
    # @api private
    #
    # @example Are we executing atomically?
    #   document.executing_atomically?
    #
    # @return [ true | false ] If we are current executing atomically.
    def executing_atomically?
      !@atomic_updates_to_execute_stack.nil?
    end

    # Post process the persistence operation.
    #

View on GitHub (pinned to 0da0e23d71)

When it happens

Trigger: Thrown at lib/mongoid/persistable.rb:142 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mongodb/mongoid@0da0e23d71 (2026-08-23). Data as JSON: /api/errors/48928e5439b4b1e8. Report an issue: GitHub.