Skip to content

Commit

Permalink
chore: fix return on bad status (#3758)
Browse files Browse the repository at this point in the history
  • Loading branch information
dranikpg authored Sep 21, 2024
1 parent cce2eb3 commit d9f8f25
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/server/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ using facade::kWrongTypeErr;

#ifndef RETURN_ON_BAD_STATUS

#define RETURN_ON_BAD_STATUS(x) \
do { \
if (!(x)) { \
return (x).status(); \
} \
#define RETURN_ON_BAD_STATUS(x) \
do { \
OpStatus __s = (x).status(); \
if (__s != OpStatus::OK) { \
return (x).status(); \
} \
} while (0)

#endif // RETURN_ON_BAD_STATUS
Expand Down

0 comments on commit d9f8f25

Please sign in to comment.