diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-08-31 14:41:44 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-08-31 14:42:55 +0000 |
commit | 3b7269f3700578c1888bec12fab6b4fb5a6536fc (patch) | |
tree | 1bbc1ddaef23e726de5ba852ca5219bc4e472862 /searchlib | |
parent | 5575a29f758a7c68d337fee3ca350b15dfa44e94 (diff) |
Catch exception and log a sensible log messagei instead of dumping core.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/apps/docstore/verifylogdatastore.cpp | 13 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/logdatastore.cpp | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/searchlib/src/apps/docstore/verifylogdatastore.cpp b/searchlib/src/apps/docstore/verifylogdatastore.cpp index 200d6051d8f..1fdef641eac 100644 --- a/searchlib/src/apps/docstore/verifylogdatastore.cpp +++ b/searchlib/src/apps/docstore/verifylogdatastore.cpp @@ -49,10 +49,15 @@ VerifyLogDataStoreApp::verify(const vespalib::string & dir) vespalib::ThreadStackExecutor executor(config.getNumThreads(), 128*1024); transactionlog::NoSyncProxy noTlSyncer; - LogDataStore store(executor, dir, config, growStrategy, tuning, - fileHeaderContext, - noTlSyncer, NULL, true); - store.verify(false); + try { + LogDataStore store(executor, dir, config, growStrategy, tuning, + fileHeaderContext, + noTlSyncer, NULL, true); + store.verify(false); + } catch (const vespalib::Exception & e) { + fprintf(stderr, "Got exception: %s", e.what()); + retval = 1; + } return retval; } diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp index f3e1be24058..bb80af4b64b 100644 --- a/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp +++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.cpp @@ -745,7 +745,7 @@ LogDataStore::preload() if ( ! isReadOnly() ) { _fileChunks.push_back(createWritableFile(FileId::first(), 0)); } else { - throw vespalib::IllegalArgument(getBaseDir() + " does not have any summary data."); + throw vespalib::IllegalArgumentException(getBaseDir() + " does not have any summary data... And that is no good in readonly case."); } } _active = FileId(_fileChunks.size() - 1); |