summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorliyangguang <liyangguang@baidu.com>2016-12-16 11:54:49 +0000
committerliyangguang <liyangguang@baidu.com>2016-12-16 11:54:49 +0000
commit57a5bbde4ede19c545c5932334782e3a755b2265 (patch)
tree21a7ef4db2bd976c45f07e7a0cd2b30c06e92ec4 /include
parent5a201dd960840c319cefd9fa9e2a40d2c76ddd73 (diff)
downloadcaffeonacl-57a5bbde4ede19c545c5932334782e3a755b2265.tar.gz
caffeonacl-57a5bbde4ede19c545c5932334782e3a755b2265.tar.bz2
caffeonacl-57a5bbde4ede19c545c5932334782e3a755b2265.zip
check leveldb iterator status for snappy format.
Diffstat (limited to 'include')
-rw-r--r--include/caffe/util/db_leveldb.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/caffe/util/db_leveldb.hpp b/include/caffe/util/db_leveldb.hpp
index e9fa0d32..4cdb6db9 100644
--- a/include/caffe/util/db_leveldb.hpp
+++ b/include/caffe/util/db_leveldb.hpp
@@ -14,7 +14,10 @@ namespace caffe { namespace db {
class LevelDBCursor : public Cursor {
public:
explicit LevelDBCursor(leveldb::Iterator* iter)
- : iter_(iter) { SeekToFirst(); }
+ : iter_(iter) {
+ SeekToFirst();
+ CHECK(iter_->status().ok()) << iter_->status().ToString();
+ }
~LevelDBCursor() { delete iter_; }
virtual void SeekToFirst() { iter_->SeekToFirst(); }
virtual void Next() { iter_->Next(); }