Exception: Async::GRPC::RemoteError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/async/grpc/remote_error.rb

Overview

Represents an error that originated from a remote gRPC server. Used as the ‘cause` of Protocol::GRPC::Error when the client receives a non-OK status. The message and optional backtrace are extracted from response metadata.

Class Method Summary collapse

Class Method Details

.for(message, metadata) ⇒ Object

Create a RemoteError from server response metadata.



16
17
18
19
20
21
22
23
# File 'lib/async/grpc/remote_error.rb', line 16

def self.for(message, )
	self.new(message).tap do |error|
		if backtrace = .delete("backtrace")
			# Backtrace is always an array (Split header format):
			error.set_backtrace(backtrace)
		end
	end
end