# 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)
Source

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

Calls superclass method `Exception::new`

### Public Instance Methods

detailed_message (...)
Source

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

Calls superclass method `Exception#detailed_message`