Kouhei Sutou
null+****@clear*****
Sat Dec 13 14:00:06 JST 2014
Kouhei Sutou 2014-12-13 14:00:06 +0900 (Sat, 13 Dec 2014) New Revision: 1b1b4f6075c072f7f44a81531396f7daa5301f5d https://github.com/droonga/droonga-engine/commit/1b1b4f6075c072f7f44a81531396f7daa5301f5d Message: add: add failure details for easy to debug Modified files: lib/droonga/plugins/crud.rb Modified: lib/droonga/plugins/crud.rb (+4 -4) =================================================================== --- lib/droonga/plugins/crud.rb 2014-12-12 12:14:10 +0900 (befd29d) +++ lib/droonga/plugins/crud.rb 2014-12-13 14:00:06 +0900 (2357fab) @@ -70,8 +70,8 @@ module Droonga end class InvalidValue < BadRequest - def initialize(column, value, request) - super("The column #{column.inspect} cannot store the value #{value.inspect}.", + def initialize(column, value, reason, request) + super("The column #{column.inspect} cannot store the value #{value.inspect}: #{reason}", request) end end @@ -117,10 +117,10 @@ module Droonga record[column] = value rescue ::Groonga::InvalidArgument => error record.delete if record.added? - raise InvalidValue.new(column, value, request) + raise InvalidValue.new(column, value, error.message, request) rescue ArgumentError => error record.delete if record.added? - raise InvalidValue.new(column, value, request) + raise InvalidValue.new(column, value, error.message, request) rescue ::Groonga::NoSuchColumn => error record.delete if record.added? raise UnknownColumn.new(column, request["table"], request) -------------- next part -------------- HTML����������������������������...Download