PHP 8.2.31
Preview: exception.rb Size: 799 B
//proc/thread-self/root/opt/alt/ruby32/share/ruby/json/add/exception.rb

#frozen_string_literal: false
unless defined?(::JSON::JSON_LOADED) and ::JSON::JSON_LOADED
  require 'json'
end

class Exception

  # Deserializes JSON string by constructing new Exception object with message
  # <tt>m</tt> and backtrace <tt>b</tt> serialized with <tt>to_json</tt>
  def self.json_create(object)
    result = new(object['m'])
    result.set_backtrace object['b']
    result
  end

  # Returns a hash, that will be turned into a JSON object and represent this
  # object.
  def as_json(*)
    {
      JSON.create_id => self.class.name,
      'm'            => message,
      'b'            => backtrace,
    }
  end

  # Stores class name (Exception) with message <tt>m</tt> and backtrace array
  # <tt>b</tt> as JSON string
  def to_json(*args)
    as_json.to_json(*args)
  end
end

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
609 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
719 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
348 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
881 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
1.30 KB lrw-r--r-- 2026-04-07 14:12:49
Edit Download
799 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
797 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
786 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
748 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
771 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
545 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
786 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
614 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download
1016 B lrw-r--r-- 2026-04-07 14:12:49
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).