larroy commented on a change in pull request #14433:  Prevent crashes for 
opencv exception and std::exception
URL: https://github.com/apache/incubator-mxnet/pull/14433#discussion_r277386822
 
 

 ##########
 File path: include/mxnet/c_api_error.h
 ##########
 @@ -31,9 +31,26 @@
  * and finishes with API_END() or API_END_HANDLE_ERROR()
  * The finally clause contains procedure to cleanup states when an error 
happens.
  */
-#define MX_API_BEGIN() try { on_enter_api(__FUNCTION__);
-#define MX_API_END() } catch(dmlc::Error &_except_) { on_exit_api(); return 
MXAPIHandleException(_except_); } on_exit_api(); return 0;  // NOLINT(*)
-#define MX_API_END_HANDLE_ERROR(Finalize) } catch(dmlc::Error &_except_) { 
Finalize; on_exit_api(); return MXAPIHandleException(_except_); } 
on_exit_api(); return 0; // NOLINT(*)
+#define MX_API_BEGIN()                                                         
\
+  try {                                                                        
\
+    on_enter_api(__FUNCTION__);
+#define MX_API_END()                                                           
\
 
 Review comment:
   is it possible to have the defines inside the scopes a bit more ordered?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to