Class: Togglefy::BulkToggleFailed

Inherits:
Error
  • Object
show all
Defined in:
lib/togglefy/errors/bulk_toggle_failed.rb

Overview

The BulkToggleFailed error is raised when a bulk toggle operation fails. This error provides additional context by allowing an optional cause to be specified.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Bulk toggle operation failed", cause = nil) ⇒ BulkToggleFailed

Initializes a new BulkToggleFailed error.

Parameters:

  • message (String) (defaults to: "Bulk toggle operation failed")

    The error message (default: “Bulk toggle operation failed”).

  • cause (Exception, nil) (defaults to: nil)

    The underlying cause of the error, if any.



12
13
14
15
16
# File 'lib/togglefy/errors/bulk_toggle_failed.rb', line 12

def initialize(message = "Bulk toggle operation failed", cause = nil)
  super(message)
  set_backtrace(cause.backtrace) if cause
  @cause = cause
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



20
21
22
# File 'lib/togglefy/errors/bulk_toggle_failed.rb', line 20

def cause
  @cause
end