summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-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