RGSSError is a subclass of StandardError

This commit is contained in:
Jonas Kulla 2014-09-26 18:20:27 +02:00
parent d223d83cbf
commit e9d0d0566b
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,6 @@ struct
} static customExc[] =
{
{ MKXP, "MKXPError" },
{ RGSS, "RGSSError" },
{ PHYSFS, "PHYSFSError" },
{ SDL, "SDLError" }
};
@ -51,6 +50,7 @@ RbData::RbData()
for (size_t i = 0; i < ARRAY_SIZE(customExc); ++i)
exc[customExc[i].id] = rb_define_class(customExc[i].name, rb_eException);
exc[RGSS] = rb_define_class("RGSSError", rb_eStandardError);
exc[Reset] = rb_define_class(rgssVer >= 3 ? "RGSSReset" : "Reset", rb_eException);
exc[ErrnoENOENT] = rb_const_get(rb_const_get(rb_cObject, rb_intern("Errno")), rb_intern("ENOENT"));

View File

@ -68,7 +68,6 @@ struct MrbExcData
static const MrbExcData excData[] =
{
{ Shutdown, "SystemExit" },
{ RGSS, "RGSSError" },
{ PHYSFS, "PHYSFSError" },
{ SDL, "SDLError" },
{ MKXP, "MKXPError" },
@ -108,6 +107,8 @@ MrbData::MrbData(mrb_state *mrb)
for (size_t i = 0; i < excDataN; ++i)
exc[excData[i].ind] = mrb_define_class(mrb, excData[i].str, mrb->eException_class);
exc[RGSS] = mrb_define_class(mrb, "RGSSError", mrb->eStandardError_class);
RClass *errnoMod = mrb_define_module(mrb, "Errno");
for (size_t i = 0; i < enoExcDataN; ++i)