summaryrefslogtreecommitdiff
path: root/lib/psych/exception.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2021-05-19 16:07:24 +0200
committerJean Boussier <jean.boussier@gmail.com>2021-05-19 16:24:18 +0200
commit441958396f40d526a62e564761d2bad534465a5b (patch)
treed8fe066d81bafe293c34d600e9fe58a130505cae /lib/psych/exception.rb
parent3fabcb953f04b4c4927b419d6d91026f65e984af (diff)
downloadpsych-441958396f40d526a62e564761d2bad534465a5b.zip
Implement YAML.safe_dump to make safe_load more usable.
In case where Psych is used as a two way serializers, e.g. to serialize some cache or config, it is preferable to have the same restrictions on both load and dump. Otherwise you might dump and persist some objects payloads that you later won't be able to read.
Diffstat (limited to 'lib/psych/exception.rb')
-rw-r--r--lib/psych/exception.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/psych/exception.rb b/lib/psych/exception.rb
index fac0c42..f473b95 100644
--- a/lib/psych/exception.rb
+++ b/lib/psych/exception.rb
@@ -7,8 +7,8 @@ module Psych
end
class DisallowedClass < Exception
- def initialize klass_name
- super "Tried to load unspecified class: #{klass_name}"
+ def initialize action, klass_name
+ super "Tried to #{action} unspecified class: #{klass_name}"
end
end
end