Method: Exceptional::ExceptionData#to_json
- Defined in:
- lib/exceptional/exception_data.rb
#to_json ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/exceptional/exception_data.rb', line 34 def to_json begin to_hash.to_json rescue NoMethodError begin require 'json' return to_hash.to_json rescue StandardError raise StandardError.new("You need a json gem/library installed to send errors to Exceptional (Object.to_json not defined). \nInstall json_pure, yajl-ruby, json-jruby, or the c-based json gem") end end end |