summaryrefslogtreecommitdiffstats
path: root/comphelper
diff options
context:
space:
mode:
authorRMZeroFour <ritobroto04@gmail.com>2024-03-24 23:00:34 +0530
committerMike Kaganski <mike.kaganski@collabora.com>2024-03-30 13:32:16 +0100
commit599b113b732190749385293a9fbc8ffc3e618556 (patch)
tree4b8a067f5ba09b97a2fda6cf434fb86fa652307b /comphelper
parenttdf#146619 Drop unused 'using namespace' in: comphelper/ (diff)
downloadcore-599b113b732190749385293a9fbc8ffc3e618556.tar.gz
core-599b113b732190749385293a9fbc8ffc3e618556.zip
tdf#42982 Add error messages to thrown exceptions
As part of the efforts in #42982 to improve the UNO API error reporting, this commit adds error messages in several files to help improve debugging experience. Change-Id: I7a51d4fd1e3a57798d70bc3464b034649948a287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165253 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/officerestartmanager.cxx2
-rw-r--r--comphelper/source/property/opropertybag.cxx2
-rw-r--r--comphelper/source/streaming/seekableinput.cxx5
3 files changed, 5 insertions, 4 deletions
diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx
index 86eb18f623c9..81e9b3351d7e 100644
--- a/comphelper/source/misc/officerestartmanager.cxx
+++ b/comphelper/source/misc/officerestartmanager.cxx
@@ -36,7 +36,7 @@ namespace comphelper
void SAL_CALL OOfficeRestartManager::requestRestart( const uno::Reference< task::XInteractionHandler >& /* xInteractionHandler */ )
{
if ( !m_xContext.is() )
- throw uno::RuntimeException();
+ throw uno::RuntimeException("no component context");
{
std::unique_lock aGuard( m_aMutex );
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index e0b389c19199..30201b9ff772 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -389,7 +389,7 @@ namespace comphelper
{
aValues = OPropertyBag_PBase::getPropertyValues( aNames );
if ( aValues.getLength() != aNames.getLength() )
- throw RuntimeException();
+ throw RuntimeException("property name and value counts out of sync");
}
catch( const RuntimeException& )
{
diff --git a/comphelper/source/streaming/seekableinput.cxx b/comphelper/source/streaming/seekableinput.cxx
index 3508f933ee26..264feaeb3071 100644
--- a/comphelper/source/streaming/seekableinput.cxx
+++ b/comphelper/source/streaming/seekableinput.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <comphelper/seekableinput.hxx>
#include <utility>
@@ -64,7 +65,7 @@ OSeekableInputWrapper::OSeekableInputWrapper(
, m_xOriginalStream(std::move( xInStream ))
{
if ( !m_xContext.is() )
- throw uno::RuntimeException();
+ throw lang::IllegalArgumentException("no component context", *this, 1);
}
@@ -91,7 +92,7 @@ void OSeekableInputWrapper::PrepareCopy_Impl()
if ( !m_xCopyInput.is() )
{
if ( !m_xContext.is() )
- throw uno::RuntimeException();
+ throw uno::RuntimeException("no component context");
uno::Reference< io::XOutputStream > xTempOut(
io::TempFile::create(m_xContext),