Exception: Appydave::Tools::Dam::BrandNotFoundError

Inherits:
DamError
  • Object
show all
Defined in:
lib/appydave/tools/dam/errors.rb

Overview

Raised when brand directory not found

Instance Method Summary collapse

Constructor Details

#initialize(brand, available_brands = nil, suggestions = nil) ⇒ BrandNotFoundError

Returns a new instance of BrandNotFoundError.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/appydave/tools/dam/errors.rb', line 11

def initialize(brand, available_brands = nil, suggestions = nil)
  message = "Brand directory not found: #{brand}"

  # Add fuzzy match suggestions if provided
  if suggestions && !suggestions.empty?
    message += "\n\nDid you mean?"
    suggestions.each { |s| message += "\n  - #{s}" }
  end

  # Add full list of available brands
  message += "\n\nAvailable brands:\n#{available_brands}" if available_brands && !available_brands.empty?
  super(message)
end