Exception: ActiveRpc::OperationFailure

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/active_rpc/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, message: nil, data: nil) ⇒ OperationFailure

Returns a new instance of OperationFailure.



5
6
7
8
9
# File 'lib/active_rpc/errors.rb', line 5

def initialize(code:, message: nil, data: nil)
  @code = code
  @message = message
  @data = data
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/active_rpc/errors.rb', line 3

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/active_rpc/errors.rb', line 3

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/active_rpc/errors.rb', line 3

def message
  @message
end

Instance Method Details

#rpc_errorObject



11
12
13
# File 'lib/active_rpc/errors.rb', line 11

def rpc_error
  Errors::OperationFailure.new(code: code, message: message, data: data)
end