[Groonga-commit] ranguba/groonga-client at c3c2cc9 [master] Import missing error class

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Dec 9 16:37:24 JST 2016


Kouhei Sutou	2016-12-09 16:37:24 +0900 (Fri, 09 Dec 2016)

  New Revision: c3c2cc977775c0cd2917fe5cbc0707ae552b7a28
  https://github.com/ranguba/groonga-client/commit/c3c2cc977775c0cd2917fe5cbc0707ae552b7a28

  Message:
    Import missing error class

  Copied files:
    lib/groonga/client/request/error.rb
      (from lib/groonga/client/request.rb)
  Modified files:
    lib/groonga/client/request.rb
    lib/groonga/client/request/select.rb

  Modified: lib/groonga/client/request.rb (+3 -0)
===================================================================
--- lib/groonga/client/request.rb    2016-12-09 16:27:28 +0900 (ca99c9f)
+++ lib/groonga/client/request.rb    2016-12-09 16:37:24 +0900 (a00ceea)
@@ -16,4 +16,7 @@
 
 require "groonga/client/script-syntax"
 
+require "groonga/client/request/base"
+require "groonga/client/request/error"
+
 require "groonga/client/request/select"

  Copied: lib/groonga/client/request/error.rb (+22 -2) 58%
===================================================================
--- lib/groonga/client/request.rb    2016-12-09 16:27:28 +0900 (ca99c9f)
+++ lib/groonga/client/request/error.rb    2016-12-09 16:37:24 +0900 (3d2a800)
@@ -14,6 +14,26 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-require "groonga/client/script-syntax"
+require "groonga/client/error"
 
-require "groonga/client/request/select"
+module Groonga
+  class Client
+    module Request
+      class Error < Client::Error
+      end
+
+      class ErrorResponse < Error
+        attr_reader :response
+        def initialize(response)
+          @response = response
+          command =****@respo*****
+          status_code =****@respo*****_code
+          error_message =****@respo*****_message
+          message = "failed to execute: #{command.name}: #{status_code}: "
+          message << "<#{error_message}>"
+          super(message)
+        end
+      end
+    end
+  end
+end

  Modified: lib/groonga/client/request/select.rb (+0 -2)
===================================================================
--- lib/groonga/client/request/select.rb    2016-12-09 16:27:28 +0900 (e0404e9)
+++ lib/groonga/client/request/select.rb    2016-12-09 16:37:24 +0900 (c0dfa99)
@@ -14,8 +14,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-require "groonga/client/request/base"
-
 module Groonga
   class Client
     module Request
-------------- next part --------------
HTML����������������������������...
下载 



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