Exception: NextStation::Operation::Halt

Inherits:
StandardError
  • Object
show all
Defined in:
lib/next_station/operation/errors.rb

Overview

Raised internally to stop the operation flow and return a failure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, msg_keys: {}, details: {}, error: nil) ⇒ Halt

Returns a new instance of Halt.

Parameters:

  • type (Symbol) (defaults to: nil)

    The error type.

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

    Keys for message interpolation.

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

    Additional error details.

  • error (NextStation::Result::Error) (defaults to: nil)

    An existing error object.



20
21
22
23
24
25
# File 'lib/next_station/operation/errors.rb', line 20

def initialize(type: nil, msg_keys: {}, details: {}, error: nil)
  @type = type
  @msg_keys = msg_keys
  @details = details
  @error = error
end

Instance Attribute Details

#detailsHash (readonly)

Returns Additional error details.

Returns:

  • (Hash)

    Additional error details.



12
13
14
# File 'lib/next_station/operation/errors.rb', line 12

def details
  @details
end

#errorNextStation::Result::Error (readonly)

Returns An existing error object.

Returns:



14
15
16
# File 'lib/next_station/operation/errors.rb', line 14

def error
  @error
end

#msg_keysHash (readonly)

Returns Keys for message interpolation.

Returns:

  • (Hash)

    Keys for message interpolation.



10
11
12
# File 'lib/next_station/operation/errors.rb', line 10

def msg_keys
  @msg_keys
end

#typeSymbol (readonly)

Returns The error type.

Returns:

  • (Symbol)

    The error type.



8
9
10
# File 'lib/next_station/operation/errors.rb', line 8

def type
  @type
end