empiredan commented on code in PR #1931:
URL: 
https://github.com/apache/incubator-pegasus/pull/1931#discussion_r1514347613


##########
src/utils/errors.h:
##########
@@ -233,6 +233,24 @@ USER_DEFINED_STRUCTURE_FORMATTER(::dsn::error_s);
         }                                                                      
                    \
     } while (false)
 
+#define RETURN_ES_NOT_OK_MSG(s, ...)                                           
                    \
+    do {                                                                       
                    \
+        const ::dsn::error_s &_s = (s);                                        
                    \
+        if (dsn_unlikely(!_s)) {                                               
                    \
+            fmt::print(stderr, "{}: {}", _s.description(), 
fmt::format(__VA_ARGS__));              \

Review Comment:
   ```suggestion
               fmt::print(stderr, "{}: {}\n", _s.description(), 
fmt::format(__VA_ARGS__));              \
   ```



##########
src/utils/errors.h:
##########
@@ -233,6 +233,24 @@ USER_DEFINED_STRUCTURE_FORMATTER(::dsn::error_s);
         }                                                                      
                    \
     } while (false)
 
+#define RETURN_ES_NOT_OK_MSG(s, ...)                                           
                    \
+    do {                                                                       
                    \
+        const ::dsn::error_s &_s = (s);                                        
                    \
+        if (dsn_unlikely(!_s)) {                                               
                    \
+            fmt::print(stderr, "{}: {}", _s.description(), 
fmt::format(__VA_ARGS__));              \
+            return _s;                                                         
                    \
+        }                                                                      
                    \
+    } while (false)
+
+#define RETURN_EC_NOT_OK_MSG(s, ...)                                           
                    \
+    do {                                                                       
                    \
+        const ::dsn::error_s &_s = (s);                                        
                    \
+        if (dsn_unlikely(!_s)) {                                               
                    \
+            fmt::print(stderr, "{}: {}", _s.description(), 
fmt::format(__VA_ARGS__));              \

Review Comment:
   ```suggestion
               fmt::print(stderr, "{}: {}\n", _s.description(), 
fmt::format(__VA_ARGS__));              \
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to