summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/exception.rb7
-rw-r--r--ext/psych/lib/psych/syntax_error.rb7
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb1
3 files changed, 11 insertions, 4 deletions
diff --git a/ext/psych/lib/psych/exception.rb b/ext/psych/lib/psych/exception.rb
new file mode 100644
index 0000000000..d96c527cfb
--- /dev/null
+++ b/ext/psych/lib/psych/exception.rb
@@ -0,0 +1,7 @@
+module Psych
+ class Exception < RuntimeError
+ end
+
+ class BadAlias < Exception
+ end
+end
diff --git a/ext/psych/lib/psych/syntax_error.rb b/ext/psych/lib/psych/syntax_error.rb
index f972256f9e..e200ef0060 100644
--- a/ext/psych/lib/psych/syntax_error.rb
+++ b/ext/psych/lib/psych/syntax_error.rb
@@ -1,8 +1,7 @@
-module Psych
- class Error < RuntimeError
- end
+require 'psych/exception'
- class SyntaxError < Error
+module Psych
+ class SyntaxError < Psych::Exception
attr_reader :file, :line, :column, :offset, :problem, :context
def initialize file, line, col, offset, problem, context
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index b59bc38830..75c7bc0c55 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -1,4 +1,5 @@
require 'psych/scalar_scanner'
+require 'psych/exception'
unless defined?(Regexp::NOENCODING)
Regexp::NOENCODING = 32