eldenmoon commented on code in PR #38035:
URL: https://github.com/apache/doris/pull/38035#discussion_r1690991296


##########
be/src/common/exception.h:
##########
@@ -139,3 +139,48 @@ inline const std::string& Exception::to_string() const {
             }                                                                  
                  \
         }                                                                      
                  \
     } while (0);
+
+#define HANDLE_EXCEPTION_IF_CATCH_EXCEPTION(stmt, handle_exception)            
                  \
+    do {                                                                       
                  \
+        try {                                                                  
                  \
+            doris::enable_thread_catch_bad_alloc++;                            
                  \
+            Defer defer {[&]() { doris::enable_thread_catch_bad_alloc--; }};   
                  \
+            {                                                                  
                  \
+                Status _status_ = (stmt);                                      
                  \
+                if (UNLIKELY(!_status_.ok())) {                                
                  \
+                    return _status_;                                           
                  \

Review Comment:
   call handle_exception() after `!_status_.ok()`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to