summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/lib/psych/syntax_error.rb5
-rw-r--r--ext/psych/parser.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ext/psych/lib/psych/syntax_error.rb b/ext/psych/lib/psych/syntax_error.rb
index f79743dba4..f972256f9e 100644
--- a/ext/psych/lib/psych/syntax_error.rb
+++ b/ext/psych/lib/psych/syntax_error.rb
@@ -1,5 +1,8 @@
module Psych
- class SyntaxError < ::SyntaxError
+ class Error < RuntimeError
+ end
+
+ class SyntaxError < Error
attr_reader :file, :line, :column, :offset, :problem, :context
def initialize file, line, col, offset, problem, context
diff --git a/ext/psych/parser.c b/ext/psych/parser.c
index 0908a1b49f..8c65ce1307 100644
--- a/ext/psych/parser.c
+++ b/ext/psych/parser.c
@@ -557,7 +557,7 @@ void Init_psych_parser()
rb_define_const(cPsychParser, "UTF16BE", INT2NUM(YAML_UTF16BE_ENCODING));
rb_require("psych/syntax_error");
- ePsychSyntaxError = rb_define_class_under(mPsych, "SyntaxError", rb_eSyntaxError);
+ ePsychSyntaxError = rb_const_get(mPsych, rb_intern("SyntaxError"));
rb_define_method(cPsychParser, "parse", parse, -1);
rb_define_method(cPsychParser, "mark", mark, 0);