[Groonga-commit] droonga/droonga-engine at 297e3c3 [buffered-forward] Cancel adding of new record when TypeError is raised.

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Mar 26 19:49:08 JST 2015


YUKI Hiroshi	2015-03-26 19:49:08 +0900 (Thu, 26 Mar 2015)

  New Revision: 297e3c33a99bbbc928702db5de42ec7d609ed173
  https://github.com/droonga/droonga-engine/commit/297e3c33a99bbbc928702db5de42ec7d609ed173

  Message:
    Cancel adding of new record when TypeError is raised.
    
    For example:
    
        TypeError: bulked object should be one of [nil, true, false,
        String, Symbol, Integer, Float, Time, Groonga::Object,
        Groonga::Record]: {"_id"=>1, "_key"=>"node0"}

  Modified files:
    lib/droonga/plugins/crud.rb

  Modified: lib/droonga/plugins/crud.rb (+3 -0)
===================================================================
--- lib/droonga/plugins/crud.rb    2015-03-26 19:39:34 +0900 (2357fab)
+++ lib/droonga/plugins/crud.rb    2015-03-26 19:49:08 +0900 (e5ff253)
@@ -121,6 +121,9 @@ module Droonga
             rescue ArgumentError => error
               record.delete if record.added?
               raise InvalidValue.new(column, value, error.message, request)
+            rescue TypeError => error
+              record.delete if record.added?
+              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 



More information about the Groonga-commit mailing list
Back to archive index