Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Proper catching invalid yml syntax across all ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
knapo committed Dec 21, 2012
1 parent 4de4ed4 commit ceb40d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/i18n/backend/base.rb
Expand Up @@ -176,7 +176,7 @@ def load_rb(filename)
def load_yml(filename)
begin
YAML.load_file(filename)
rescue TypeError, SyntaxError => e
rescue TypeError, ScriptError, StandardError => e
raise InvalidLocaleData.new(filename, e.inspect)
end
end
Expand Down
7 changes: 4 additions & 3 deletions test/test_data/locales/invalid/syntax.yml
@@ -1,3 +1,4 @@
foo
bar: baz
foo
en:
foo: foo
bar:
baz:

0 comments on commit ceb40d4

Please sign in to comment.