Exception: Gritz::Error

Inherits:
StandardError
  • Object
show all
Defined in:
/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb

Overview

Transport-independent status and rich error details.

Constant Summary collapse

CODE =
:unknown
GRPC_CODE =
2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, details: [], metadata: {}, remote: false) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 9

def initialize(message = nil, details: [], metadata: {}, remote: false)
  super(message || code.to_s.tr("_", " "))
  @details = details
  @metadata = 
  @remote = remote
end

Instance Attribute Details

#details ⇒ Object (readonly)



7
8
9
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 7

def details
  @details
end

#metadata ⇒ Object (readonly)



7
8
9
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 7

def 
  @metadata
end

Instance Method Details

#code ⇒ Object



16
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 16

def code = self.class::CODE

#grpc_code ⇒ Object



17
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 17

def grpc_code = self.class::GRPC_CODE

#remote? ⇒ Boolean

Returns:

  • (Boolean)


18
# File '/home/runner/work/gritz/gritz/sources/gritz-core/lib/gritz/errors.rb', line 18

def remote? = @remote