Exception: Restate::TerminalError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/restate/errors.rb,
sig/restate.rbs

Overview

Raised to indicate a non-retryable failure. Restate will not retry the invocation.

Examples:

raise Restate::TerminalError.new('not found', status_code: 404)
raise Restate::TerminalError.new('bad input', metadata: { 'field' => 'name' })

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = 'Internal Server Error', status_code: 500, metadata: nil) ⇒ TerminalError

Returns a new instance of TerminalError.

Parameters:

  • message (String) (defaults to: 'Internal Server Error')
  • status_code: (Integer) (defaults to: 500)
  • metadata: (Hash[String, String], nil) (defaults to: nil)


13
14
15
16
17
# File 'lib/restate/errors.rb', line 13

def initialize(message = 'Internal Server Error', status_code: 500, metadata: nil)
  super(message)
  @status_code = status_code
  @metadata = 
end

Instance Attribute Details

#metadataHash[String, String]? (readonly)

Returns the value of attribute metadata.

Returns:

  • (Hash[String, String], nil)


11
12
13
# File 'lib/restate/errors.rb', line 11

def 
  @metadata
end

#status_codeInteger (readonly)

Returns the value of attribute status_code.

Returns:

  • (Integer)


11
12
13
# File 'lib/restate/errors.rb', line 11

def status_code
  @status_code
end