YUKI Hiroshi
null+****@clear*****
Wed Feb 12 12:31:38 JST 2014
YUKI Hiroshi 2014-02-12 12:31:38 +0900 (Wed, 12 Feb 2014) New Revision: 1d0a874cd21811ee17d4ccdf413c078f7f59f891 https://github.com/droonga/fluent-plugin-droonga/commit/1d0a874cd21811ee17d4ccdf413c078f7f59f891 Message: Output error class name Modified files: lib/droonga/catalog_loader.rb lib/droonga/startup_error.rb Modified: lib/droonga/catalog_loader.rb (+1 -1) =================================================================== --- lib/droonga/catalog_loader.rb 2014-02-12 12:26:27 +0900 (eab0b32) +++ lib/droonga/catalog_loader.rb 2014-02-12 12:31:38 +0900 (fff57d9) @@ -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.to_s}", error) + raise InvalidCatalog.new("Syntax error in #{@path}", error) end end end Modified: lib/droonga/startup_error.rb (+14 -2) =================================================================== --- lib/droonga/startup_error.rb 2014-02-12 12:26:27 +0900 (9c72040) +++ lib/droonga/startup_error.rb 2014-02-12 12:31:38 +0900 (ac78022) @@ -17,11 +17,23 @@ module Droonga class StartupError < StandardError - attr_reader :message, :detail - def initialize(message, detail=nil) @message = message @detail = detail end + + def message + detail = self.detail + detail = "\n#{detail}" unless detail.empty? + "#{self.class.name}\n#{@message}#{detail}" + end + + def detail + if @detail + @detail.to_s + else + "" + end + end end end -------------- next part -------------- HTML����������������������������...Download