Exception: Nokogiri::XML::SyntaxError
- Inherits:
-
SyntaxError
- Object
- SyntaxError
- Nokogiri::XML::SyntaxError
- Defined in:
- lib/nokogiri/xml/syntax_error.rb,
ext/nokogiri/xml_syntax_error.c
Instance Method Summary collapse
-
#code ⇒ Object
Get the error code.
-
#column ⇒ Object
Column number or 0 if not available.
-
#domain ⇒ Object
Get the part of the library that raised this exception.
- #error? ⇒ Boolean
- #fatal? ⇒ Boolean
-
#file ⇒ Object
Get the filename for the error.
-
#int1 ⇒ Object
Extra number information.
-
#level ⇒ Object
Get the error level.
-
#line ⇒ Object
Get the line number of the error.
-
#message ⇒ Object
Get the human readable message.
- #none? ⇒ Boolean
-
#str1 ⇒ Object
Extra string information.
-
#str2 ⇒ Object
Extra string information.
-
#str3 ⇒ Object
Extra string information.
- #warning? ⇒ Boolean
Instance Method Details
#code ⇒ Object
Get the error code
129 130 131 132 133 134 |
# File 'ext/nokogiri/xml_syntax_error.c', line 129 static VALUE code(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM(error->code); } |
#column ⇒ Object
Column number or 0 if not available
16 17 18 19 20 21 |
# File 'ext/nokogiri/xml_syntax_error.c', line 16 static VALUE column(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM(error->int2); } |
#domain ⇒ Object
Get the part of the library that raised this exception
142 143 144 145 146 147 |
# File 'ext/nokogiri/xml_syntax_error.c', line 142 static VALUE domain(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM(error->domain); } |
#error? ⇒ Boolean
12 13 14 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 12 def error? level == 2 end |
#fatal? ⇒ Boolean
16 17 18 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 16 def fatal? level == 3 end |
#file ⇒ Object
Get the filename for the error
100 101 102 103 104 105 106 107 108 |
# File 'ext/nokogiri/xml_syntax_error.c', line 100 static VALUE file(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); if(error->file) return rb_str_new2(error->file); return Qnil; } |
#int1 ⇒ Object
Extra number information
29 30 31 32 33 34 |
# File 'ext/nokogiri/xml_syntax_error.c', line 29 static VALUE int1(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM(error->int1); } |
#level ⇒ Object
Get the error level
116 117 118 119 120 121 |
# File 'ext/nokogiri/xml_syntax_error.c', line 116 static VALUE level(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM((short)error->level); } |
#line ⇒ Object
Get the line number of the error
87 88 89 90 91 92 |
# File 'ext/nokogiri/xml_syntax_error.c', line 87 static VALUE line(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return INT2NUM(error->line); } |
#message ⇒ Object
Get the human readable message.
155 156 157 158 159 160 |
# File 'ext/nokogiri/xml_syntax_error.c', line 155 static VALUE (VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); return rb_str_new2(error->); } |
#none? ⇒ Boolean
4 5 6 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 4 def none? level == 0 end |
#str1 ⇒ Object
Extra string information
72 73 74 75 76 77 78 79 |
# File 'ext/nokogiri/xml_syntax_error.c', line 72 static VALUE str1(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); if(error->str1) return rb_str_new2(error->str1); return Qnil; } |
#str2 ⇒ Object
Extra string information
57 58 59 60 61 62 63 64 |
# File 'ext/nokogiri/xml_syntax_error.c', line 57 static VALUE str2(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); if(error->str2) return rb_str_new2(error->str2); return Qnil; } |
#str3 ⇒ Object
Extra string information
42 43 44 45 46 47 48 49 |
# File 'ext/nokogiri/xml_syntax_error.c', line 42 static VALUE str3(VALUE self) { xmlErrorPtr error; Data_Get_Struct(self, xmlError, error); if(error->str3) return rb_str_new2(error->str3); return Qnil; } |
#warning? ⇒ Boolean
8 9 10 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 8 def warning? level == 1 end |