summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych/exception.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych/exception.rb')
-rw-r--r--ext/psych/lib/psych/exception.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/exception.rb b/ext/psych/lib/psych/exception.rb
index f473b95a3b..d7469a4b30 100644
--- a/ext/psych/lib/psych/exception.rb
+++ b/ext/psych/lib/psych/exception.rb
@@ -6,6 +6,20 @@ module Psych
class BadAlias < Exception
end
+ # Subclasses `BadAlias` for backwards compatibility
+ class AliasesNotEnabled < BadAlias
+ def initialize
+ super "Alias parsing was not enabled. To enable it, pass `aliases: true` to `Psych::load` or `Psych::safe_load`."
+ end
+ end
+
+ # Subclasses `BadAlias` for backwards compatibility
+ class AnchorNotDefined < BadAlias
+ def initialize anchor_name
+ super "An alias referenced an unknown anchor: #{anchor_name}"
+ end
+ end
+
class DisallowedClass < Exception
def initialize action, klass_name
super "Tried to #{action} unspecified class: #{klass_name}"