YUKI Hiroshi
null+****@clear*****
Wed Feb 12 12:16:48 JST 2014
YUKI Hiroshi 2014-02-12 12:16:48 +0900 (Wed, 12 Feb 2014) New Revision: 1baf1b7bd561e3e3d7e02a846d7034404662de7e https://github.com/droonga/fluent-plugin-droonga/commit/1baf1b7bd561e3e3d7e02a846d7034404662de7e Message: Define base class for startp errors Copied files: lib/droonga/startup_error.rb (from lib/droonga/catalog.rb) Modified files: lib/droonga/catalog.rb lib/droonga/catalog_loader.rb Modified: lib/droonga/catalog.rb (+2 -7) =================================================================== --- lib/droonga/catalog.rb 2014-02-12 12:00:41 +0900 (b9b2a69) +++ lib/droonga/catalog.rb 2014-02-12 12:16:48 +0900 (5edb73e) @@ -16,18 +16,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require "droonga/catalog_loader" +require "droonga/startup_error" module Droonga class << self attr_accessor :catalog end - class InvalidCatalog < StandardError - attr_reader :message, :detail - - def initialize(message, detail=nil) - @message = message - @detail = detail - end + class InvalidCatalog < StartupError end end Modified: lib/droonga/catalog_loader.rb (+1 -1) =================================================================== --- lib/droonga/catalog_loader.rb 2014-02-12 12:00:41 +0900 (fff57d9) +++ lib/droonga/catalog_loader.rb 2014-02-12 12:16:48 +0900 (eab0b32) @@ -29,7 +29,7 @@ module Droonga end Catalog::Version1.new(data, File.dirname(@path)) rescue JSON::ParserError => error - raise InvalidCatalog.new("Syntax error in #{@path}", error) + raise InvalidCatalog.new("Syntax error in #{@path}: #{error.to_s}", error) end end end Copied: lib/droonga/startup_error.rb (+2 -8) 84% =================================================================== --- lib/droonga/catalog.rb 2014-02-12 12:00:41 +0900 (b9b2a69) +++ lib/droonga/startup_error.rb 2014-02-12 12:16:48 +0900 (9c72040) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2013 Droonga Project +# Copyright (C) 2014 Droonga Project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,14 +15,8 @@ # 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/catalog_loader" - module Droonga - class << self - attr_accessor :catalog - end - - class InvalidCatalog < StandardError + class StartupError < StandardError attr_reader :message, :detail def initialize(message, detail=nil) -------------- next part -------------- HTML����������������������������...Download