Kouhei Sutou
null+****@clear*****
Wed Nov 5 16:52:53 JST 2014
Kouhei Sutou 2014-11-05 16:52:53 +0900 (Wed, 05 Nov 2014) New Revision: 112a7cb3ef848c2938adb653b248af9959b540ce https://github.com/ranguba/rroonga/commit/112a7cb3ef848c2938adb653b248af9959b540ce Message: Support GRN_TOKEN_FILTER_ERROR Modified files: ext/groonga/rb-grn-exception.c test/test-exception.rb Modified: ext/groonga/rb-grn-exception.c (+18 -1) =================================================================== --- ext/groonga/rb-grn-exception.c 2014-11-03 18:22:25 +0900 (47c7ec7) +++ ext/groonga/rb-grn-exception.c 2014-11-05 16:52:53 +0900 (818b74d) @@ -1,6 +1,6 @@ /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* - Copyright (C) 2009-2012 Kouhei Sutou <kou �� clear-code.com> + Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> Copyright (C) 2014 Masafumi Yokoyama <myokoym �� gmail.com> This library is free software; you can redistribute it and/or @@ -96,6 +96,7 @@ static VALUE eGrnTooSmallLimit; static VALUE eGrnCASError; static VALUE eGrnUnsupportedCommandVersion; static VALUE eGrnNormalizerError; +static VALUE eGrnTokenFilterError; VALUE rb_grn_rc_to_exception (grn_rc rc) @@ -325,6 +326,9 @@ rb_grn_rc_to_exception (grn_rc rc) case GRN_NORMALIZER_ERROR: exception = eGrnNormalizerError; break; + case GRN_TOKEN_FILTER_ERROR: + exception = eGrnTokenFilterError; + break; } if (NIL_P(exception)) @@ -561,6 +565,9 @@ rb_grn_rc_to_message (grn_rc rc) case GRN_NORMALIZER_ERROR: message = "normalizer error"; break; + case GRN_TOKEN_FILTER_ERROR: + message = "token filter error"; + break; } if (!message) @@ -1210,4 +1217,14 @@ rb_grn_init_exception (VALUE mGrn) */ eGrnNormalizerError = rb_define_class_under(mGrn, "NormalizerError", rb_eGrnError); + + /* + * Document-class: Groonga::TokenFilterError + * + * It is used when a token filter causes an error. + * + * @since 4.0.6 + */ + eGrnTokenFilterError = + rb_define_class_under(mGrn, "TokenFilterError", rb_eGrnError); } Modified: test/test-exception.rb (+2 -1) =================================================================== --- test/test-exception.rb 2014-11-03 18:22:25 +0900 (2f3432b) +++ test/test-exception.rb 2014-11-05 16:52:53 +0900 (c1607c0) @@ -1,4 +1,4 @@ -# Copyright (C) 2009-2010 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> # Copyright (C) 2014 Masafumi Yokoyama <myokoym �� gmail.com> # # This library is free software; you can redistribute it and/or @@ -93,6 +93,7 @@ class ExceptionTest < Test::Unit::TestCase assert_const_defined(Groonga, :TooSmallOffset) assert_const_defined(Groonga, :TooLargeOffset) assert_const_defined(Groonga, :TooSmallLimit) + assert_const_defined(Groonga, :TokenFilterError) end end -------------- next part -------------- HTML����������������������������...下載