YUKI Hiroshi
null+****@clear*****
Thu Dec 26 13:21:01 JST 2013
YUKI Hiroshi 2013-12-26 13:21:01 +0900 (Thu, 26 Dec 2013) New Revision: 06e6c3b15ca56c20b003fd81c1ee86a0f400de17 https://github.com/droonga/fluent-plugin-droonga/commit/06e6c3b15ca56c20b003fd81c1ee86a0f400de17 Merged d5217b2: Merge branch 'master' of 192.168.1.21:~piro/groonga/fluent-plugin-droonga into HEAD Message: Define base class for responsible errors with general name Modified files: lib/droonga/handler_plugin.rb lib/droonga/plugin/handler/add.rb Renamed files: lib/droonga/responsible_error.rb (from lib/droonga/handler_error.rb) Modified: lib/droonga/handler_plugin.rb (+2 -2) =================================================================== --- lib/droonga/handler_plugin.rb 2013-12-26 12:56:30 +0900 (c6d99b4) +++ lib/droonga/handler_plugin.rb 2013-12-26 13:21:01 +0900 (c3861fe) @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require "droonga/plugin" -require "droonga/handler_error" +require "droonga/responsible_error" module Droonga class HandlerPlugin < Plugin @@ -36,7 +36,7 @@ module Droonga def run_command(command, message, messenger) begin super - rescue HandlerError => error + rescue ResponsibleError => error messenger.error(error.status_code, error.response_body) end end Modified: lib/droonga/plugin/handler/add.rb (+2 -1) =================================================================== --- lib/droonga/plugin/handler/add.rb 2013-12-26 12:56:30 +0900 (7851458) +++ lib/droonga/plugin/handler/add.rb 2013-12-26 13:21:01 +0900 (ab94ca0) @@ -18,12 +18,13 @@ require "groonga" require "droonga/handler_plugin" +require "droonga/responsible_error" module Droonga class AddHandler < Droonga::HandlerPlugin repository.register("add", self) - class InvalidRequest < HandlerClientError + class InvalidRequest < ResponsibleClientError end class MissingTable < InvalidRequest Renamed: lib/droonga/responsible_error.rb (+3 -3) 93% =================================================================== --- lib/droonga/handler_error.rb 2013-12-26 12:56:30 +0900 (837637d) +++ lib/droonga/responsible_error.rb 2013-12-26 13:21:01 +0900 (aefccac) @@ -14,9 +14,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module Droonga - class HandlerError < StandardError + class ResponsibleError attr_reader :message, :detail - + def initialize(message, detail=nil) @message = message @detail = detail @@ -40,7 +40,7 @@ module Droonga end end - class HandlerClientError < HandlerError + class ResponsibleClientError < ResponsibleError def status_code 400 end -------------- next part -------------- HTML����������������������������...Download