lib/mrkt/errors.rb in mrkt-0.9.0 vs lib/mrkt/errors.rb in mrkt-0.10.0
- old
+ new
@@ -23,10 +23,11 @@
608 => 'APITemporarilyUnavailable',
609 => 'InvalidJSON',
610 => 'RequestedResourceNotFound',
611 => 'System',
612 => 'InvalidContentType',
+ 702 => 'RecordNotFound',
703 => 'DisabledFeature',
1001 => 'TypeMismatch',
1002 => 'MissingParamater',
1003 => 'UnspecifiedAction',
1004 => 'LeadNotFound',
@@ -38,12 +39,12 @@
1010 => 'PartitionUpdateDenied',
1011 => 'FieldNotSupported',
1012 => 'InvalidCookieValue',
1013 => 'ObjectNotFound',
1014 => 'FailedToCreateObject'
- }
+ }.freeze
- RESPONSE_CODE_TO_ERROR.values.each do |class_name|
+ RESPONSE_CODE_TO_ERROR.each_value do |class_name|
const_set(class_name, create_class)
end
def self.find_by_response_code(response_code)
const_get(RESPONSE_CODE_TO_ERROR.fetch(response_code, 'Error'))