alinaliBQ commented on code in PR #48577:
URL: https://github.com/apache/arrow/pull/48577#discussion_r2641493148


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_handle.h:
##########
@@ -46,7 +46,18 @@ class ODBCHandle {
     try {
       GetDiagnostics().Clear();
       rc = function();
-    } catch (const arrow::flight::sql::odbc::DriverException& ex) {
+    } catch (const arrow::flight::sql::odbc::AuthenticationException& ex) {
+      GetDiagnostics().AddError(arrow::flight::sql::odbc::DriverException(
+          ex.GetMessageText(), ex.GetSqlState(), ex.GetNativeError()));
+    } catch (const arrow::flight::sql::odbc::NullWithoutIndicatorException& 
ex) {
+      GetDiagnostics().AddError(arrow::flight::sql::odbc::DriverException(
+          ex.GetMessageText(), ex.GetSqlState(), ex.GetNativeError()));
+    }
+    // on mac, DriverException doesn't catch the subclass exceptions hence we 
added
+    // the following above.
+    // GH-48278 TODO investigate if there is a way to catch all the subclass 
exceptions
+    // under DriverException
+    catch (const arrow::flight::sql::odbc::DriverException& ex) {

Review Comment:
   Yes this is odd, it does seem like undefined behavior. clang being more 
strict is a possibility. 
   Without this change, on mac `std::exception` is caught instead of 
`DriverException`, so the exception is still caught but not under 
`DriverException` which is preferred 



-- 
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]

Reply via email to