class JSON::GeneratorError - json: Ruby Standard Library Documentation

# class JSON::GeneratorError

This exception is raised if a generator or unparser error occurs.

### Attributes

invalid_object[R]

### Public Class Methods

new(message, invalid_object = nil) click to toggle source
Calls superclass method

    # File json/lib/json/common.rb, line 149
    def initialize(message, invalid_object = nil)
      super(message)
      @invalid_object = invalid_object
    end

### Public Instance Methods

detailed_message(...) click to toggle source
Calls superclass method

    # File json/lib/json/common.rb, line 154
    def detailed_message(...)
      if @invalid_object.nil?
        super
      else
        "#{super}\nInvalid object: #{@invalid_object.inspect}"
      end
    end