diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-26 11:00:50 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-26 11:01:08 +0100 |
commit | b7da8304477428c317e20e1df7e469077bd1d8a3 (patch) | |
tree | d5848a6b50488db0d44f8a6e054d5833e57718e2 /xmlreader/source | |
parent | a8afa224362619387cc87928d8a0392396eb8bb2 (diff) |
Better exception message.
Diffstat (limited to 'xmlreader/source')
-rw-r--r-- | xmlreader/source/xmlreader.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx index 05782eeb70dd..08456625a0f9 100644 --- a/xmlreader/source/xmlreader.cxx +++ b/xmlreader/source/xmlreader.cxx @@ -72,7 +72,9 @@ XmlReader::XmlReader(rtl::OUString const & fileUrl) css::container::NoSuchElementException, css::uno::RuntimeException)): fileUrl_(fileUrl) { - switch (osl_openFile(fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read)) + oslFileError e = osl_openFile( + fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read); + switch (e) { case osl_File_E_None: break; @@ -82,10 +84,11 @@ XmlReader::XmlReader(rtl::OUString const & fileUrl) default: throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot open ")) + - fileUrl_), + fileUrl_ + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(": ")) + + rtl::OUString::valueOf(static_cast< sal_Int32 >(e))), css::uno::Reference< css::uno::XInterface >()); } - oslFileError e = osl_getFileSize(fileHandle_, &fileSize_); + e = osl_getFileSize(fileHandle_, &fileSize_); if (e == osl_File_E_None) { e = osl_mapFile( fileHandle_, &fileAddress_, fileSize_, 0, |