null+****@clear*****
null+****@clear*****
2011年 11月 24日 (木) 17:43:02 JST
Yoji SHIDARA 2011-11-24 08:43:02 +0000 (Thu, 24 Nov 2011) New Revision: a3cd35c8a9b127792b92a15a0b758024d070d427 Log: throw error message passed from context Modified files: src/nroonga.cc Modified: src/nroonga.cc (+3 -0) =================================================================== --- src/nroonga.cc 2011-11-24 07:15:22 +0000 (4595be1) +++ src/nroonga.cc 2011-11-24 08:43:02 +0000 (40b4625) @@ -41,6 +41,9 @@ Handle<Value> Database::New(const Arguments& args) { } else if(args[0]->IsString()) { String::Utf8Value path(args[0]->ToString()); GRN_DB_OPEN_OR_CREATE(ctx, *path, NULL, db->database); + if (ctx->rc != GRN_SUCCESS) { + return ThrowException(Exception::Error(String::New(ctx->errbuf))); + } if (!db->database) { return ThrowException(Exception::Error(String::New("DB open failed"))); }