* error.c (Init_Exception): introduce EncodingError which is a

superclass for all encoding related exception classes,
  e.g. Encoding::CompatibilityError.  [ruby-dev:36371]

* transcode.c (Init_transcode): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-09-26 03:53:11 +00:00
Родитель edebd815b0
Коммит 3deb806a06
4 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -632,6 +632,14 @@ Thu Sep 18 22:35:03 2008 Yusuke Endoh <mame@tsg.ne.jp>
* test/bigdecimal/test_bigdecimal.rb: add tests for above.
Thu Sep 18 22:20:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* error.c (Init_Exception): introduce EncodingError which is a
superclass for all encoding related exception classes,
e.g. Encoding::CompatibilityError. [ruby-dev:36371]
* transcode.c (Init_transcode): ditto.
Thu Sep 18 21:57:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* string.c (rb_str_comparable): make ascii8bit string to be

Просмотреть файл

@ -323,6 +323,7 @@ VALUE rb_eIndexError;
VALUE rb_eKeyError;
VALUE rb_eRangeError;
VALUE rb_eNameError;
VALUE rb_eEncodingError;
VALUE rb_eEncCompatError;
VALUE rb_eNoMethodError;
VALUE rb_eSecurityError;
@ -1056,7 +1057,8 @@ Init_Exception(void)
rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError);
rb_eSecurityError = rb_define_class("SecurityError", rb_eException);
rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException);
rb_eEncCompatError = rb_define_class_under(rb_cEncoding, "CompatibilityError", rb_eStandardError);
rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);
rb_eEncCompatError = rb_define_class_under(rb_cEncoding, "CompatibilityError", rb_eEncodingError);
syserr_tbl = st_init_numtable();
rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError);

Просмотреть файл

@ -1036,6 +1036,7 @@ RUBY_EXTERN VALUE rb_eFloatDomainError;
RUBY_EXTERN VALUE rb_eLocalJumpError;
RUBY_EXTERN VALUE rb_eSysStackError;
RUBY_EXTERN VALUE rb_eRegexpError;
RUBY_EXTERN VALUE rb_eEncodingError;
RUBY_EXTERN VALUE rb_eEncCompatError;
RUBY_EXTERN VALUE rb_eScriptError;

Просмотреть файл

@ -3995,9 +3995,9 @@ extern void Init_newline(void);
void
Init_transcode(void)
{
rb_eUndefinedConversionError = rb_define_class_under(rb_cEncoding, "UndefinedConversionError", rb_eStandardError);
rb_eInvalidByteSequenceError = rb_define_class_under(rb_cEncoding, "InvalidByteSequenceError", rb_eStandardError);
rb_eConverterNotFoundError = rb_define_class_under(rb_cEncoding, "ConverterNotFoundError", rb_eStandardError);
rb_eUndefinedConversionError = rb_define_class_under(rb_cEncoding, "UndefinedConversionError", rb_eEncodingError);
rb_eInvalidByteSequenceError = rb_define_class_under(rb_cEncoding, "InvalidByteSequenceError", rb_eEncodingError);
rb_eConverterNotFoundError = rb_define_class_under(rb_cEncoding, "ConverterNotFoundError", rb_eEncodingError);
transcoder_table = st_init_strcasetable();