refactor: return OpResult in DbSlice::AddOrFind instead of throwing std::bad_alloc (#2427)

* return OpResult in AddOrFind instead of throwing bad_alloc
* small refactor
This commit is contained in:
Kostas Kyrimis 2024-01-23 14:16:03 +02:00 committed by GitHub
parent 1074bcb30b
commit 517be2005e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 209 additions and 213 deletions

View file

@ -33,6 +33,17 @@ using facade::kWrongTypeErr;
#endif // RETURN_ON_ERR
#ifndef RETURN_ON_BAD_STATUS
#define RETURN_ON_BAD_STATUS(x) \
do { \
if (!(x)) { \
return (x).status(); \
} \
} while (0)
#endif // RETURN_ON_BAD_STATUS
namespace rdb {
enum errc {