From b16eaf86324b000c4c349e072e15b97dde701e48 Mon Sep 17 00:00:00 2001 From: marcandre Date: Tue, 6 Feb 2018 23:52:30 +0000 Subject: lib/ostruct.rb: Use `FrozenError` instead of `RuntimeError`. Patch by Yuuji Yaginuma. [Fixes GH-1808] In other classes, `FrozenError` will be raised if change the frozen object. In order to match the behavior, I think that `FrozenError` should use in `OpenStruct`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/ostruct.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ostruct.rb') diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 28890304e4..f2380144f3 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -156,7 +156,7 @@ class OpenStruct begin @modifiable = true rescue - raise RuntimeError, "can't modify frozen #{self.class}", caller(3) + raise FrozenError, "can't modify frozen #{self.class}", caller(3) end @table end -- cgit v1.2.3