class PyCall::PyError

Attributes

traceback[R]
type[R]
value[R]

Public Class Methods

new(type, value, traceback) click to toggle source
Calls superclass method
# File lib/pycall/pyerror.rb, line 5
def initialize(type, value, traceback)
  @type = type
  @value = value
  @traceback = traceback
  super("Exception occurred in Python")
end

Public Instance Methods

to_s() click to toggle source
# File lib/pycall/pyerror.rb, line 14
def to_s
  "#{type}: #{value}".tap do |msg|
    if (strs = format_traceback)
      msg << "\n"
      strs.each {|s| msg << s }
    end
  end
end

Private Instance Methods

format_traceback() click to toggle source
# File lib/pycall/pyerror.rb, line 25
def format_traceback
  return nil if traceback.nil?
  ::PyCall.import_module('traceback').format_tb(traceback)
end