YUKI Hiroshi
null+****@clear*****
Thu Dec 26 15:47:57 JST 2013
YUKI Hiroshi 2013-12-26 15:47:57 +0900 (Thu, 26 Dec 2013) New Revision: 4f4db87c1cd12fdd7f5056b8595685e55667003a https://github.com/droonga/fluent-plugin-droonga/commit/4f4db87c1cd12fdd7f5056b8595685e55667003a Message: Handle unknown dataset error Modified files: lib/droonga/dispatcher.rb Modified: lib/droonga/dispatcher.rb (+7 -0) =================================================================== --- lib/droonga/dispatcher.rb 2013-12-26 16:34:13 +0900 (17907c3) +++ lib/droonga/dispatcher.rb 2013-12-26 15:47:57 +0900 (9224cfc) @@ -38,6 +38,12 @@ module Droonga end end + class UnknownDataset < BadRequest + def initialize(dataset) + super("The dataset #{dataset.inspect} does not exist.") + end + end + class UnknownCommand < BadRequest def initialize(command, dataset) super("The command #{command.inspect} is not available " + @@ -157,6 +163,7 @@ module Droonga dataset = component["dataset"] if dataset routes = Droonga.catalog.get_routes(dataset, component) + raise UnknownDataset.new(dataset) if routes.empty? component["routes"] = routes else component["routes"] ||= [id] -------------- next part -------------- HTML����������������������������...Download