module PipeRpc class Hub::Request class ErrorResult def initialize(request, error) @request, @error = request, Error.new(error) end def value @error.error end def to_response ErrorResponse.new(id: @request.id, error: { code: @error.code, data: { message: @error.message, backtrace: @error.backtrace, method: @request.method, args: @request.arguments } }) end end end end