Exception: Hanami::Mailer::MissingAttachmentError

Inherits:
Error
  • Object
show all
Defined in:
lib/hanami/mailer/errors.rb

Overview

Raised when a static attachment file cannot be found

Instance Method Summary collapse

Constructor Details

#initialize(filename, paths = []) ⇒ MissingAttachmentError

Returns a new instance of MissingAttachmentError.



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/hanami/mailer/errors.rb', line 42

def initialize(filename, paths = [])
  message =
    if paths.any?
      "Attachment file not found: #{filename}. "\
      "Searched in: #{paths.join(', ')}"
    else
      "Attachment file not found: #{filename}. " \
      "Configure `attachment_paths` to specify where attachment files are located."
    end
  super(message)
end