Skip to content

Commit d9f8f25

Browse files
authored
chore: fix return on bad status (#3758)
1 parent cce2eb3 commit d9f8f25

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/server/error.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ using facade::kWrongTypeErr;
3535

3636
#ifndef RETURN_ON_BAD_STATUS
3737

38-
#define RETURN_ON_BAD_STATUS(x) \
39-
do { \
40-
if (!(x)) { \
41-
return (x).status(); \
42-
} \
38+
#define RETURN_ON_BAD_STATUS(x) \
39+
do { \
40+
OpStatus __s = (x).status(); \
41+
if (__s != OpStatus::OK) { \
42+
return (x).status(); \
43+
} \
4344
} while (0)
4445

4546
#endif // RETURN_ON_BAD_STATUS

0 commit comments

Comments
 (0)