Better exception handling in odbc_backend