diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-14 15:29:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-15 12:25:00 +0200 |
commit | ec87e11f0e4bb6f53eb0c5d2575f590aea95269f (patch) | |
tree | 8080b5547479ca07112b98f14076defae0a31cd4 /dbaccess | |
parent | 4466466a5c57a0d19ad8559ac699cf073f7e3e97 (diff) |
loplugin:logexceptionnicely in dbaccess
Change-Id: I2d702b699c2e61dbb363eff671bb43d4ddbf8ee3
Reviewed-on: https://gerrit.libreoffice.org/74045
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 20 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 4 |
4 files changed, 20 insertions, 19 deletions
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index ee4491d52606..c93067ab2944 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -135,9 +135,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) != ResultSetType::FORWARD_ONLY) _xRs->beforeFirst(); } - catch(const SQLException& e) + catch(const SQLException&) { - SAL_WARN("dbaccess.core", "ORowSetCache: " << e); + TOOLS_WARN_EXCEPTION("dbaccess.core", "ORowSetCache"); } // check if all keys of the updateable table are fetched @@ -181,9 +181,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, m_aKeyColumns = pCursor->getJoinedKeyColumns(); return; } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("dbaccess.core", "ORowSetCache: " << e); + TOOLS_WARN_EXCEPTION("dbaccess.core", "ORowSetCache"); } m_xCacheSet.clear(); } @@ -221,9 +221,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } } } - catch (Exception const& e) + catch (Exception const&) { - SAL_WARN("dbaccess.core", "ORowSetCache: " << e); + TOOLS_WARN_EXCEPTION("dbaccess.core", "ORowSetCache"); } } @@ -249,9 +249,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } } } - catch (const SQLException& e) + catch (const SQLException&) { - SAL_WARN("dbaccess.core", "ORowSetCache: " << e); + TOOLS_WARN_EXCEPTION("dbaccess.core", "ORowSetCache"); bNeedKeySet = true; } @@ -328,9 +328,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, if(bNoInsert) m_nPrivileges |= ~Privilege::INSERT; // remove the insert privilege } - catch (const SQLException& e) + catch (const SQLException&) { - SAL_WARN("dbaccess.core", "ORowSetCache: " << e); + TOOLS_WARN_EXCEPTION("dbaccess.core", "ORowSetCache"); // we couldn't create a keyset here so we have to create a static cache m_xCacheSet = new OStaticSet(i_nMaxRows); m_xCacheSet->construct(_xRs,i_sRowSetFilter); diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 27bc17bd762d..355f9cafcf0b 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -115,12 +115,10 @@ static ErrCode ReadThroughComponent( { xParser->parseStream( aParserInput ); } - catch (const SAXParseException& r) + catch (const SAXParseException&) { #if OSL_DEBUG_LEVEL > 0 - SAL_WARN("dbaccess", "SAX parse exception caught while importing: " << r << r.LineNumber << "," << r.ColumnNumber); -#else - (void)r; + TOOLS_WARN_EXCEPTION("dbaccess", "SAX parse exception caught while importing"); #endif return ErrCode(1); } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 0bf3e8a4fec8..1684ce4ba1dd 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -60,6 +60,7 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <svl/rngitem.hxx> +#include <tools/diagnose_ex.h> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -936,9 +937,9 @@ Reference< XPropertySet > SbaGridControl::getField(sal_uInt16 nModelPos) else OSL_FAIL("SbaGridControl::getField getColumns returns NULL or ModelPos is > than count!"); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("dbaccess", "SbaGridControl::getField Exception occurred: " << e); + TOOLS_WARN_EXCEPTION("dbaccess", "SbaGridControl::getField Exception occurred"); } return xEmptyReturn; @@ -971,9 +972,9 @@ bool SbaGridControl::IsReadOnlyDB() const } } } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("dbaccess", "SbaGridControl::IsReadOnlyDB Exception occurred: " << e); + TOOLS_WARN_EXCEPTION("dbaccess", "SbaGridControl::IsReadOnlyDB Exception occurred"); } return bDBIsReadOnly; diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 6bdb682f32d7..9c7f5ce9b62e 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2387,7 +2387,9 @@ bool SbaTableQueryBrowser::implLoadAnything(const OUString& _rDataSourceName, co if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) showError( SQLExceptionInfo( e.TargetException ) ); else - SAL_WARN("dbaccess", e); + { + TOOLS_WARN_EXCEPTION("dbaccess", ""); + } } catch(const Exception&) { |