Method: GRPC::BadStatus#initialize

Defined in:
src/ruby/lib/grpc/errors.rb

#initialize(code, details = 'unknown cause', metadata = {}, debug_error_string = nil) ⇒ BadStatus

Returns a new instance of BadStatus.

Parameters:

  • code (Numeric)

    the status code

  • details (String) (defaults to: 'unknown cause')

    the details of the exception

  • metadata (Hash) (defaults to: {})

    the error’s metadata


40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'src/ruby/lib/grpc/errors.rb', line 40

def initialize(code,
               details = 'unknown cause',
                = {},
               debug_error_string = nil)
  exception_message = "#{code}:#{details}"
  if debug_error_string
    exception_message += ". debug_error_string:{#{debug_error_string}}"
  end
  super(exception_message)
  @code = code
  @details = details
  @metadata = 
  @debug_error_string = debug_error_string
end