mruby/mruby — pull request #996 by tsahara-iij (2013-03-13 01:16:20+00:00)
Title: mrb_sys_fail raises an instance of (subclass of) SystemCallError if we have it

The function mrb_sys_fail() should be very useful for writing error handling in extension modules call some system calls. But current implementation of mrb_sys_fail() always raises RuntimeError, though rb_sys_fail in CRuby raises an exception which is one of subclasses of SystemCallError. With this pull-request, mrb_sys_fail() calls SystemCallError._sys_fail to raise same exception as CRuby's rb_sys_fail if we have a SystemCallError class (with mrbgem or something).

Note: here is an implementation of SystemCallError: https://github.com/iij/mruby-errno .