Exception: Bovem::Errors::Error

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/bovem/errors.rb

Overview

This exception is raised when something goes wrong.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, reason, message) ⇒ Error

Initializes a new error

Parameters:

  • target (Object)

    The target of this error.

  • reason (Symbol)

    The reason of failure.

  • message (String)

    A human readable message.



36
37
38
39
40
41
42
# File 'lib/bovem/errors.rb', line 36

def initialize(target, reason, message)
  super(message)

  @target = target
  @reason = reason
  @message = message
end

Instance Attribute Details

#messageString (readonly)

Returns A human readable message.

Returns:

  • (String)

    A human readable message.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bovem/errors.rb', line 26

class Error < ArgumentError
  attr_reader :target
  attr_reader :reason
  attr_reader :message

  # Initializes a new error
  #
  # @param target [Object] The target of this error.
  # @param reason [Symbol] The reason of failure.
  # @param message [String] A human readable message.
  def initialize(target, reason, message)
    super(message)

    @target = target
    @reason = reason
    @message = message
  end
end

#reasonSymbol (readonly)

Returns The reason of failure.

Returns:

  • (Symbol)

    The reason of failure.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bovem/errors.rb', line 26

class Error < ArgumentError
  attr_reader :target
  attr_reader :reason
  attr_reader :message

  # Initializes a new error
  #
  # @param target [Object] The target of this error.
  # @param reason [Symbol] The reason of failure.
  # @param message [String] A human readable message.
  def initialize(target, reason, message)
    super(message)

    @target = target
    @reason = reason
    @message = message
  end
end

#targetObject (readonly)

Returns The target of this error.

Returns:

  • (Object)

    The target of this error.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bovem/errors.rb', line 26

class Error < ArgumentError
  attr_reader :target
  attr_reader :reason
  attr_reader :message

  # Initializes a new error
  #
  # @param target [Object] The target of this error.
  # @param reason [Symbol] The reason of failure.
  # @param message [String] A human readable message.
  def initialize(target, reason, message)
    super(message)

    @target = target
    @reason = reason
    @message = message
  end
end