Class | ArkanisDevelopment::SimpleLocalization::EntryFormatError |
In: |
lib/errors.rb
|
Parent: | SimpleLocalizationError |
Error raised if the format method for a language file entry fails. The main purpose of this error is to make debuging easier if format fails. Therefore the detailed error message.
Language.use :en begin Language.entry :active_record_messages, :too_short, ['a'] rescue EntryFormatError => e e.language # => :en e.entry # => [:active_record_messages, :too_short] e.entry_content # => 'is too short (minimum is %d characters)' e.format_values # => ['a'] e.original_exception # => #<ArgumentError: invalid value for Integer: "a"> end
entry | [R] | |
entry_content | [R] | |
format_values | [R] | |
language | [R] | |
original_exception | [R] |
# File lib/errors.rb, line 75 75: def initialize(language, entry, entry_content, format_values, original_exception) 76: @language, @entry, @entry_content, @format_values, @original_exception = language, entry, entry_content, format_values, original_exception 77: super "An error occured while formating the language file entry '#{@entry.join('\' -> \'')}'.\n" + 78: "Format string: '#{@entry_content}'\n" + 79: "Format arguments: #{@format_values.collect{|v| v.inspect}.join(', ')}\n" + 80: "Original exception: #{@original_exception.inspect}" 81: end