lib/i18n/exceptions.rb in lawrencepit-i18n-0.1.6 vs lib/i18n/exceptions.rb in lawrencepit-i18n-0.2.0.1
- old
+ new
@@ -1,5 +1,13 @@
+# encoding: utf-8
+
+class KeyError < IndexError
+ def initialize(message = nil)
+ super(message || "key not found")
+ end
+end unless defined?(KeyError)
+
module I18n
class ArgumentError < ::ArgumentError; end
class InvalidLocale < ArgumentError
attr_reader :locale
@@ -26,13 +34,13 @@
super "translation data #{entry.inspect} can not be used with :count => #{count}"
end
end
class MissingInterpolationArgument < ArgumentError
- attr_reader :key, :string
- def initialize(key, string)
- @key, @string = key, string
- super "interpolation argument #{key} missing in #{string.inspect}"
+ attr_reader :values, :string
+ def initialize(values, string)
+ @values, @string = values, string
+ super "missing interpolation argument in #{string.inspect} (#{values.inspect} given)"
end
end
class ReservedInterpolationKey < ArgumentError
attr_reader :key, :string
\ No newline at end of file