class PostDB::SetupError

The SetupError error is used when a setup error occurs

Attributes

arguments[R]

An array containing additional arguments

attribute[R]

A suberror to describe the error in more detail

Public Class Methods

new(suberror = nil, *args) click to toggle source

Create a new instance of this exception

Arguments:

suberror: (Symbol|String)
args: (Array)

Example:

>> raise PostDB::SetupError.new
=> #<PostDB::SetupError:0x00000000000000>
# File lib/postdb/errors/setup.rb, line 23
  def initialize(suberror = nil, *args)
          # Store the suberror property (if provided)
          @suberror = suberror if suberror

# Store the arguments
@arguments = args
  end

Public Instance Methods

to_s() click to toggle source

Convert the error to a string

Example:

>> error.to_s
=> "Error Description"
Calls superclass method
# File lib/postdb/errors/setup.rb, line 37
def to_s
  case @suberror
  when :invalid_adapter
    "The adapter '#{@arguments[0]}' is not valid."
  when :missing_database_args
    "You must provide the database configuration."
  when :missing_mail_args
    "You must provide the mail configuration."
  when :missing_dkim_args
    "You must provide the DKIM configuration."
  when :missing_mail_location
    "You must provide the mail location string."
  when :missing_dkim_directory
    "You must provide the path to the DKIM keys directory."
  when :missing_trusted_hosts_path
    "You must provide the path to the DKIM TrustedHosts file."
  when :missing_key_table_path
    "You must provide the path to the DKIM KeyTable file."
  when :missing_signing_table_path
    "You must provide the path to the DKIM SigningTable file."
  else
    super.to_s
  end
end