diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-14 12:58:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-14 13:24:58 +0000 |
commit | c8b77ecc6d3d910578223055fa88937e2b9a5bc7 (patch) | |
tree | 6c44362d00cc67e3c01dd24324bbff7e3ffbffa7 | |
parent | b3bc0b369cee21f6fbe50e74534b21e9d968b1cd (diff) |
coverity#1339308 Uncaught exception
Change-Id: Id63bbdd11af66de6be8a3e9dfca1c7efbe74b08a
-rw-r--r-- | l10ntools/inc/po.hxx | 2 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 13 | ||||
-rw-r--r-- | l10ntools/source/po.cxx | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index 830db7d9e054..24f9c28a4ed6 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -123,7 +123,7 @@ private: public: - enum Exception { INVALIDENTRY }; + class Exception : public std::exception { }; PoIfstream(); PoIfstream( const OString& rFileName ); diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index e7b552222e6a..dd6639b70dc8 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -45,15 +45,12 @@ namespace { rPoFile.readEntry( o_rPoEntry ); } - catch( PoIfstream::Exception& aException ) + catch (const PoIfstream::Exception&) { - if( aException == PoIfstream::INVALIDENTRY ) - { - printf( - "Warning : %s contains invalid entry\n", - rFileName.getStr() ); - return false; - } + printf( + "Warning : %s contains invalid entry\n", + rFileName.getStr() ); + return false; } return true; } diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 00f7d8270414..3019006c33bd 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -596,7 +596,7 @@ void PoIfstream::readEntry( PoEntry& rPoEntry ) } else { - throw INVALIDENTRY; + throw PoIfstream::Exception(); } } } |