Commit 0d514aaa by 李福中

统一异常错误消息为`field`格式不正确

parent d0a3119d
...@@ -95,7 +95,7 @@ module RailsParam ...@@ -95,7 +95,7 @@ module RailsParam
end end
return nil return nil
rescue ArgumentError rescue ArgumentError
raise InvalidParameterError, error_message_for(nil, "#{options[:label] || param}不是合法的#{data_type_i18n(type)}", options) raise InvalidParameterError, error_message_for(nil, "#{options[:label] || param}格式不正确", options)
end end
end end
...@@ -145,19 +145,5 @@ module RailsParam ...@@ -145,19 +145,5 @@ module RailsParam
end end
end end
def data_type_i18n(type)
{
Integer => '整数',
Float => '数字',
String => '字符串',
Date => '日期',
Time => '时间',
DateTime => '日期时间',
Array => '数组',
Hash => '哈希',
BigDecimal => '数字'
}
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment