summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-18 18:38:19 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-18 18:38:19 +0000
commitb09ad2b8476d3e42d35ef8bf17cbfa94d45150e1 (patch)
treebf9ef752e42a8d46834b9da81069402b7f17f2a7 /ext/psych/lib/psych
parentda3cdd2ddf9cabc4f50ee7461c04a24333c4eb34 (diff)
* ext/psych/lib/psych/visitors/to_ruby.rb (resolve_klass): fix the
exception message when attempting to load an unknown class. Thanks nobu! [ruby-dev:41399] * test/psych/test_psych.rb: test for the exception message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index e28ac7bf87..ffff636d8e 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -246,13 +246,13 @@ module Psych
begin
path2class(name)
- rescue ArgumentError => ex
- name = "Struct::#{name}"
+ rescue ArgumentError, NameError => ex
unless retried
- retried = true
+ name = "Struct::#{name}"
+ retried = ex
retry
end
- raise ex
+ raise retried
end
end
end