class Kitchen::Terraform::Raise::ClientError

ClientError is the class of objects which handle errors that are caused by incorrect use of an API.

Attributes

logger[RW]

Public Class Methods

new(logger:) click to toggle source

initialize prepares a new instance of the class.

@param logger [Kitchen::Logger] a logger to log messages. @return [Kitchen::Terraform::ClientError]

# File lib/kitchen/terraform/raise/client_error.rb, line 39
def initialize(logger:)
  self.logger = logger
end

Public Instance Methods

call(message:) click to toggle source

call logs an error message and raises an error with the message.

@param message [String] the error message. @raise [Kitchen::ClientError] @return [void]

# File lib/kitchen/terraform/raise/client_error.rb, line 29
def call(message:)
  logger.error message

  raise ::Kitchen::ClientError, message
end