class Psych::Visitors::YAMLTree

def visit_Exception o

def visit_Exception o
  tag = ['!ruby/exception', o.class.name].join ':'
  @emitter.start_mapping nil, tag, false, Nodes::Mapping::BLOCK
  {
    'message'   => private_iv_get(o, 'mesg'),
    'backtrace' => private_iv_get(o, 'backtrace'),
  }.each do |k,v|
    next unless v
    @emitter.scalar k, nil, nil, true, false, Nodes::Scalar::ANY
    accept v
  end
  dump_ivars o
  @emitter.end_mapping
end