mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
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:
parent
1074bcb30b
commit
517be2005e
16 changed files with 209 additions and 213 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue