[Groonga-commit] droonga/fluent-plugin-droonga at 5ab1c3e [master] Refer basic error class correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Feb 19 15:54:01 JST 2014


YUKI Hiroshi	2014-02-19 15:54:01 +0900 (Wed, 19 Feb 2014)

  New Revision: 5ab1c3edc03d6e23d81d43510cc0741ab37ae5ea
  https://github.com/droonga/fluent-plugin-droonga/commit/5ab1c3edc03d6e23d81d43510cc0741ab37ae5ea

  Message:
    Refer basic error class correctly

  Modified files:
    lib/droonga/dispatcher.rb
    lib/droonga/plugins/crud.rb
    lib/droonga/searcher.rb

  Modified: lib/droonga/dispatcher.rb (+3 -3)
===================================================================
--- lib/droonga/dispatcher.rb    2014-02-19 15:50:51 +0900 (040e72d)
+++ lib/droonga/dispatcher.rb    2014-02-19 15:54:01 +0900 (490ec87)
@@ -29,19 +29,19 @@ module Droonga
   class Dispatcher
     attr_reader :name
 
-    class MissingDatasetParameter < BadRequest
+    class MissingDatasetParameter < ErrorMessage::BadRequest
       def initialize
         super("\"dataset\" must be specified.")
       end
     end
 
-    class UnknownDataset < NotFound
+    class UnknownDataset < ErrorMessage::NotFound
       def initialize(dataset)
         super("The dataset #{dataset.inspect} does not exist.")
       end
     end
 
-    class UnknownCommand < BadRequest
+    class UnknownCommand < ErrorMessage::BadRequest
       def initialize(command, dataset)
         super("The command #{command.inspect} is not available " +
                 "for the dataset #{dataset.inspect}.")

  Modified: lib/droonga/plugins/crud.rb (+5 -5)
===================================================================
--- lib/droonga/plugins/crud.rb    2014-02-19 15:50:51 +0900 (a85b4f7)
+++ lib/droonga/plugins/crud.rb    2014-02-19 15:54:01 +0900 (5694043)
@@ -50,33 +50,33 @@ module Droonga
       class Handler < Droonga::Handler
         message.type = "add"
 
-        class MissingTableParameter < BadRequest
+        class MissingTableParameter < ErrorMessage::BadRequest
           def initialize
             super("\"table\" must be specified.")
           end
         end
 
-        class MissingPrimaryKeyParameter < BadRequest
+        class MissingPrimaryKeyParameter < ErrorMessage::BadRequest
           def initialize(table_name)
             super("\"key\" must be specified. " +
                     "The table #{table_name.inspect} requires a primary key for a new record.")
           end
         end
 
-        class UnknownTable < NotFound
+        class UnknownTable < ErrorMessage::NotFound
           def initialize(table_name)
             super("The table #{table_name.inspect} does not exist in the dataset.")
           end
         end
 
-        class InvalidValue < BadRequest
+        class InvalidValue < ErrorMessage::BadRequest
           def initialize(column, value, request)
             super("The column #{column.inspect} cannot store the value #{value.inspect}.",
                   request)
           end
         end
 
-        class UnknownColumn < NotFound
+        class UnknownColumn < ErrorMessage::NotFound
           def initialize(column, table, request)
             super("The column #{column.inspect} does not exist in the table #{table.inspect}.",
                   request)

  Modified: lib/droonga/searcher.rb (+4 -4)
===================================================================
--- lib/droonga/searcher.rb    2014-02-19 15:50:51 +0900 (81b14a9)
+++ lib/droonga/searcher.rb    2014-02-19 15:54:01 +0900 (f585cd7)
@@ -24,13 +24,13 @@ require "droonga/error_message"
 
 module Droonga
   class Searcher
-    class NoQuery < BadRequest
+    class NoQuery < ErrorMessage::BadRequest
       def initialize
         super("You must specify one or more query.")
       end
     end
 
-    class MissingSourceParameter < BadRequest
+    class MissingSourceParameter < ErrorMessage::BadRequest
       def initialize(query, queries)
         super("The query #{query.inspect} has no source. " +
                 "Query must have a valid source.",
@@ -38,7 +38,7 @@ module Droonga
       end
     end
 
-    class UnknownSource < NotFound
+    class UnknownSource < ErrorMessage::NotFound
       def initialize(source, queries)
         super("The source #{source.inspect} does not exist. " +
                 "It must be a name of an existing table or another query.",
@@ -46,7 +46,7 @@ module Droonga
       end
     end
 
-    class CyclicSource < BadRequest
+    class CyclicSource < ErrorMessage::BadRequest
       def initialize(queries)
         super("There is cyclic reference of sources.",
               queries)
-------------- next part --------------
HTML����������������������������...
Télécharger 



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