| 16 | #include <memenv.h> |
| 17 | |
| 18 | void HandleError(const leveldb::Status& status) |
| 19 | { |
| 20 | if (status.ok()) |
| 21 | return; |
| 22 | LogPrintf("%s\n", status.ToString()); |
| 23 | if (status.IsCorruption()) |
| 24 | throw leveldb_error("Database corrupted"); |
| 25 | if (status.IsIOError()) |
| 26 | throw leveldb_error("Database I/O error"); |
| 27 | if (status.IsNotFound()) |
| 28 | throw leveldb_error("Database entry missing"); |
| 29 | throw leveldb_error("Unknown database error"); |
| 30 | } |
| 31 | |
| 32 | static void SetMaxOpenFiles(leveldb::Options *options) { |
| 33 | // On most platforms the default setting of max_open_files (which is 1000) |
no test coverage detected