Exception: Honey::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/honey/error.rb

Constant Summary collapse

CODES =
{
  999 => "An invalid username / password has been submitted.  Please contact Honey's Place.",
  800 => "First Name is required.",
  801 => "Last Name is required.",
  802 => "Address1 is required.",
  803 => "City is required.",
  804 => "State is required.",
  805 => "Zip Code is required.",
  806 => "Zip Code is invalid.",
  807 => "Country is invalid.",
  808 => "E-Mail is invalid.",
  809 => "State must be only 2 characters.",
  700 => "Reference number already used.",
  701 => "Reference number is required.",
  600 => "Invalid Shipping Code.",
  500 => "One or more of the submitted products have been discontinued by the manufacturer.",
  501 => "One or more of the submitted products do not exist.",
  400 => "Duplicate product within same order.  Please combine SKU's and QTY.",
  300 => "You are checking status on an order you have not yet submitted.",
  100 => "Order accepted for processing.",
  0   => "Unknown Error.  Please contact Honey's Place."
}

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Error

Returns a new instance of Error.



3
4
5
6
# File 'lib/honey/error.rb', line 3

def initialize(code)
  @code = code
  super(message)
end

Instance Method Details

#messageObject



8
9
10
# File 'lib/honey/error.rb', line 8

def message
  CODES[@code]
end