123456789_123456789_123456789_123456789_123456789_

Exception: JSON::GeneratorError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, JSONError, StandardError
Instance Chain:
self, JSONError, StandardError
Inherits: JSON::JSONError
Defined in: ext/json/lib/json/common.rb

Overview

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(message, invalid_object = nil) ⇒ GeneratorError

[ GitHub ]

  
# File 'ext/json/lib/json/common.rb', line 149

def initialize(message, invalid_object = nil)
  super(message)
  @invalid_object = invalid_object
end

Instance Attribute Details

#invalid_object (readonly)

[ GitHub ]

  
# File 'ext/json/lib/json/common.rb', line 147

attr_reader :invalid_object

Instance Method Details

#detailed_message

[ GitHub ]

  
# 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