Exception: DS9::Exception

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ds9.rb,
ext/ds9/ds9.c

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str, code) ⇒ Exception

Returns a new instance of Exception.



111
112
113
114
# File 'lib/ds9.rb', line 111

def initialize str, code
  @code = code
  super(str)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



109
110
111
# File 'lib/ds9.rb', line 109

def code
  @code
end

Class Method Details

.abort(code) ⇒ Object



105
106
107
# File 'lib/ds9.rb', line 105

def self.abort code
  raise new(to_string(code), code)
end

.to_string(err) ⇒ Object



939
940
941
942
# File 'ext/ds9/ds9.c', line 939

static VALUE errors_to_string(VALUE mod, VALUE err)
{
    return rb_usascii_str_new2(nghttp2_strerror(NUM2INT(err)));
}