[Groonga-commit] ranguba/rroonga at feff6b1 [master] Support GRN_ZSTD_ERROR

Back to archive index

Masafumi Yokoyama null+****@clear*****
Tue Dec 6 01:23:25 JST 2016


Masafumi Yokoyama	2016-12-06 01:23:25 +0900 (Tue, 06 Dec 2016)

  New Revision: feff6b1d9965ab91576713a9e91f821e192e250f
  https://github.com/ranguba/rroonga/commit/feff6b1d9965ab91576713a9e91f821e192e250f

  Message:
    Support GRN_ZSTD_ERROR

  Modified files:
    ext/groonga/rb-grn-exception.c
    test/test-exception.rb

  Modified: ext/groonga/rb-grn-exception.c (+15 -1)
===================================================================
--- ext/groonga/rb-grn-exception.c    2016-12-06 00:47:46 +0900 (1c71aa3)
+++ ext/groonga/rb-grn-exception.c    2016-12-06 01:23:25 +0900 (4e5b427)
@@ -1,7 +1,7 @@
 /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
-  Copyright (C) 2014-2015  Masafumi Yokoyama <yokoyama �� clear-code.com>
   Copyright (C) 2009-2016  Kouhei Sutou <kou �� clear-code.com>
+  Copyright (C) 2014-2016  Masafumi Yokoyama <yokoyama �� clear-code.com>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -102,6 +102,7 @@ static VALUE eGrnPluginError;
 static VALUE eGrnScorerError;
 static VALUE eGrnCancel;
 static VALUE eGrnWindowFunctionError;
+static VALUE eGrnZstdError;
 
 VALUE
 rb_grn_rc_to_exception (grn_rc rc)
@@ -349,6 +350,9 @@ rb_grn_rc_to_exception (grn_rc rc)
       case GRN_WINDOW_FUNCTION_ERROR:
         exception = eGrnWindowFunctionError;
         break;
+      case GRN_ZSTD_ERROR:
+        exception = eGrnZstdError;
+        break;
     }
 
     if (NIL_P(exception))
@@ -1058,4 +1062,14 @@ rb_grn_init_exception (VALUE mGrn)
      */
     eGrnWindowFunctionError =
         rb_define_class_under(mGrn, "WindowFunctionError", rb_eGrnError);
+
+    /*
+     * Document-class: Groonga::ZstdError
+     *
+     * It is used when Zstd causes an error.
+     *
+     * @since 6.1.1
+     */
+    eGrnZstdError =
+        rb_define_class_under(mGrn, "ZstdError", rb_eGrnError);
 }

  Modified: test/test-exception.rb (+2 -1)
===================================================================
--- test/test-exception.rb    2016-12-06 00:47:46 +0900 (f46b5f5)
+++ test/test-exception.rb    2016-12-06 01:23:25 +0900 (852cdb8)
@@ -1,5 +1,5 @@
-# Copyright (C) 2014-2015  Masafumi Yokoyama <yokoyama �� clear-code.com>
 # Copyright (C) 2009-2014  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2014-2016  Masafumi Yokoyama <yokoyama �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -100,6 +100,7 @@ class ExceptionTest < Test::Unit::TestCase
     assert_const_defined(Groonga, :CommandError)
     assert_const_defined(Groonga, :PluginError)
     assert_const_defined(Groonga, :ScorerError)
+    assert_const_defined(Groonga, :ZstdError)
   end
 end
 
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index