[Groonga-commit] droonga/droonga-client-ruby at b00965c [master] Add error classes

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Nov 21 12:56:09 JST 2013


Kouhei Sutou	2013-11-21 12:56:09 +0900 (Thu, 21 Nov 2013)

  New Revision: b00965c2f942104592e48020c450cbb06739c65e
  https://github.com/droonga/droonga-client-ruby/commit/b00965c2f942104592e48020c450cbb06739c65e

  Message:
    Add error classes

  Added files:
    lib/droonga/client/connection/error.rb
    lib/droonga/client/error.rb

  Added: lib/droonga/client/connection/error.rb (+38 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/client/connection/error.rb    2013-11-21 12:56:09 +0900 (d229cf0)
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+require "droonga/client/error"
+
+module Droonga
+  class Client
+    module Connection
+      # The top error class of connection module.
+      class Error < Client::Error
+      end
+
+      # The error class for invalid response type is specified.
+      class InvalidResponseType < Error
+        attr_reader :type
+        def initialize(type)
+          @type = type
+          super("Unknown response type: <#{@type}>. " +
+                  "Available types: [:none, :one]")
+        end
+      end
+    end
+  end
+end

  Added: lib/droonga/client/error.rb (+24 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/client/error.rb    2013-11-21 12:56:09 +0900 (e0e6e21)
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013 Droonga Project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+module Droonga
+  class Client
+    # The top error class of droonga-client.
+    class Error < StandardError
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



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