Exception: R::UnwrapFailedError

Inherits:
StandardError
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/r/unwrap_failed_error.rb

Overview

UnwrapFailedError is raised by Result#unwrap! and Result#unwrap_err! (and their variants Result#expect! and Result#expect_err!) when called on the wrong result type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, value) ⇒ void

Parameters:

  • message (String)
  • value (T.anything)


20
21
22
23
# File 'lib/r/unwrap_failed_error.rb', line 20

def initialize(message, value)
  super(format_message(message, value))
  @value = value
end

Instance Attribute Details

#valueT.anything (readonly)

Returns:

  • (T.anything)


17
18
19
# File 'lib/r/unwrap_failed_error.rb', line 17

def value
  @value
end