diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-19 10:05:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-19 10:12:47 +0100 |
commit | 6e818f0a063a2db37361e42f9c49d4bb9e44945a (patch) | |
tree | 97fe08f67fd635c13f674bad968009f3c393b32b /sax | |
parent | 53a4cbad22a22518d097113f30819a6ece468bbf (diff) |
improve exception message
Change-Id: Ia87e6e22e9a28b714d09c952fa9c52817b4dd21d
Reviewed-on: https://gerrit.libreoffice.org/83159
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 9b35c1682be5..55e1a345f331 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -889,15 +889,15 @@ void FastSaxParserImpl::setTokenHandler( const Reference< XFastTokenHandler >& x void FastSaxParserImpl::registerNamespace( const OUString& NamespaceURL, sal_Int32 NamespaceToken ) { - if( NamespaceToken >= FastToken::NAMESPACE ) + if( NamespaceToken < FastToken::NAMESPACE ) + throw IllegalArgumentException("Invalid namespace token " + OUString::number(NamespaceToken), css::uno::Reference<css::uno::XInterface >(), 0); + + if( GetNamespaceToken( NamespaceURL ) == FastToken::DONTKNOW ) { - if( GetNamespaceToken( NamespaceURL ) == FastToken::DONTKNOW ) - { - maNamespaceMap[ NamespaceURL ] = NamespaceToken; - return; - } + maNamespaceMap[ NamespaceURL ] = NamespaceToken; + return; } - throw IllegalArgumentException(); + throw IllegalArgumentException("namespace URL is already registered: " + NamespaceURL, css::uno::Reference<css::uno::XInterface >(), 0); } OUString const & FastSaxParserImpl::getNamespaceURL( const OUString& rPrefix ) |