From 6956e3379b0c7bd8fc9e822fd58a71f038084b6d Mon Sep 17 00:00:00 2001 From: Hieronymous Date: Thu, 13 Oct 2016 17:53:30 +0530 Subject: Improve UNO error reporting. Make exceptions more descriptive. Change-Id: I7f7462d2fe2fa29361fd51871bf43bcc5e817944 Reviewed-on: https://gerrit.libreoffice.org/29771 Tested-by: jan iversen Reviewed-by: jan iversen --- basic/source/uno/namecont.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'basic') diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index b374fd26e439..566e349c2772 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -303,7 +303,7 @@ void SAL_CALL NameContainer::addContainerListener( const Reference< XContainerLi if( !xListener.is() ) { throw RuntimeException("addContainerListener called with null xListener", - static_cast< cppu::OWeakObject * >(this)); + static_cast< cppu::OWeakObject * >(this)); } maContainerListeners.addInterface( Reference(xListener, UNO_QUERY) ); } @@ -313,7 +313,8 @@ void SAL_CALL NameContainer::removeContainerListener( const Reference< XContaine { if( !xListener.is() ) { - throw RuntimeException(); + throw RuntimeException("removeContainerListener called with null xListener", + static_cast< cppu::OWeakObject * >(this)); } maContainerListeners.removeInterface( Reference(xListener, UNO_QUERY) ); } @@ -324,7 +325,8 @@ void SAL_CALL NameContainer::addChangesListener( const Reference< XChangesListen { if( !xListener.is() ) { - throw RuntimeException(); + throw RuntimeException("addChangesListener called with null xListener", + static_cast< cppu::OWeakObject * >(this)); } maChangesListeners.addInterface( Reference(xListener, UNO_QUERY) ); } @@ -334,7 +336,8 @@ void SAL_CALL NameContainer::removeChangesListener( const Reference< XChangesLis { if( !xListener.is() ) { - throw RuntimeException(); + throw RuntimeException("removeChangesListener called with null xListener", + static_cast< cppu::OWeakObject * >(this)); } maChangesListeners.removeInterface( Reference(xListener, UNO_QUERY) ); } -- cgit