Exception: JSONRPC2::KnownError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/jsonrpc2/interface.rb

Overview

KnownError - thrown when a predictable error occurs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



27
28
29
# File 'lib/jsonrpc2/interface.rb', line 27

def code
  @code
end

#dataObject

Returns the value of attribute data.



27
28
29
# File 'lib/jsonrpc2/interface.rb', line 27

def data
  @data
end

Class Method Details

.exception(args) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/jsonrpc2/interface.rb', line 28

def self.exception(args)
  code, message, data = *args
  exception = new(message)
  exception.code = code
  exception.data = data
  exception
end