class Farcall::RemoteError
The error occured while executin remote method. Inf an exception is raused while executing remote method, it will be passed back and raised in the caller thread with an instance of this class.
The remote can throw regular or extended errors. Extended errors can pass any data to the other end, which will be available as {#data}.
To carry error data just raise any exception which respnd_to(:data), which should return hash with any application specific error data, as in this sample error class:
class MyError < StandardError def data { foo: bar } end end
Attributes
data[R]
data passed by the remote error or an empty hash
remote_class[R]
The class of the remote error. Usually string name of the class or any other useful string identifier.
Public Class Methods
new(remote_class, text, data={})
click to toggle source
Calls superclass method
# File lib/farcall/transport.rb, line 29 def initialize remote_class, text, data={} @remote_class, @data = remote_class, data super "#{remote_class}: #{text}" end