HAYASHI Kentaro
null+****@clear*****
Thu Apr 2 11:55:30 JST 2015
HAYASHI Kentaro 2015-04-02 11:55:30 +0900 (Thu, 02 Apr 2015) New Revision: f891320c85946fa79900bcaf05faebb7cfebdbf3 https://github.com/ranguba/rroonga/commit/f891320c85946fa79900bcaf05faebb7cfebdbf3 Merged 4437782: Merge pull request #58 from kenhys/support-grn-scorer-error Message: Support GRN_SCORER_ERROR It's introduced since Groonga 5.0.1. Modified files: ext/groonga/rb-grn-exception.c test/test-exception.rb Modified: ext/groonga/rb-grn-exception.c (+17 -0) =================================================================== --- ext/groonga/rb-grn-exception.c 2015-04-01 19:12:00 +0900 (5966d2a) +++ ext/groonga/rb-grn-exception.c 2015-04-02 11:55:30 +0900 (13befe0) @@ -99,6 +99,7 @@ static VALUE eGrnNormalizerError; static VALUE eGrnTokenFilterError; static VALUE eGrnCommandError; static VALUE eGrnPluginError; +static VALUE eGrnScorerError; VALUE rb_grn_rc_to_exception (grn_rc rc) @@ -337,6 +338,9 @@ rb_grn_rc_to_exception (grn_rc rc) case GRN_PLUGIN_ERROR: exception = eGrnPluginError; break; + case GRN_SCORER_ERROR: + exception = eGrnScorerError; + break; } if (NIL_P(exception)) @@ -582,6 +586,9 @@ rb_grn_rc_to_message (grn_rc rc) case GRN_PLUGIN_ERROR: message = "plugin error"; break; + case GRN_SCORER_ERROR: + message = "scorer error"; + break; } if (!message) @@ -1261,4 +1268,14 @@ rb_grn_init_exception (VALUE mGrn) */ eGrnPluginError = rb_define_class_under(mGrn, "PluginError", rb_eGrnError); + + /* + * Document-class: Groonga::ScorerError + * + * It is used when a scorer causes an error. + * + * @since 5.0.1 + */ + eGrnPluginError = + rb_define_class_under(mGrn, "ScorerError", rb_eGrnError); } Modified: test/test-exception.rb (+1 -0) =================================================================== --- test/test-exception.rb 2015-04-01 19:12:00 +0900 (a57356d) +++ test/test-exception.rb 2015-04-02 11:55:30 +0900 (f46b5f5) @@ -99,6 +99,7 @@ class ExceptionTest < Test::Unit::TestCase assert_const_defined(Groonga, :TokenFilterError) assert_const_defined(Groonga, :CommandError) assert_const_defined(Groonga, :PluginError) + assert_const_defined(Groonga, :ScorerError) end end -------------- next part -------------- HTML����������������������������...다운로드