editeng/source/uno/unotext.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit e211607dffe2986601359dcb1ef757fda3805fb3 Author: Mohit Marathe <mohitmara...@proton.me> AuthorDate: Sun Mar 24 22:06:46 2024 +0530 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Tue Apr 9 09:06:27 2024 +0200 tdf#42982: Improve UNO API error reporting Change-Id: If075965f2b020767b35692ea110ca768daf342c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165228 Tested-by: Jenkins Reviewed-by: Hossein <hoss...@libreoffice.org> diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 09a117d82123..b5f329e62050 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -314,7 +314,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextRangeBase::getStart() SvxUnoTextBase* pText = comphelper::getFromUnoTunnel<SvxUnoTextBase>( getText() ); if(pText == nullptr) - throw uno::RuntimeException(); + throw uno::RuntimeException("Failed to retrieve a valid text base object from the Uno Tunnel"); rtl::Reference<SvxUnoTextRange> pRange = new SvxUnoTextRange( *pText ); xRange = pRange; @@ -342,7 +342,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextRangeBase::getEnd() SvxUnoTextBase* pText = comphelper::getFromUnoTunnel<SvxUnoTextBase>( getText() ); if(pText == nullptr) - throw uno::RuntimeException(); + throw uno::RuntimeException("Failed to retrieve a valid text base object from the Uno Tunnel"); rtl::Reference<SvxUnoTextRange> pNew = new SvxUnoTextRange( *pText ); xRet = pNew; @@ -704,12 +704,12 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet const & rSet, cons { SfxItemState eState = rSet.GetItemState( EE_PARA_NUMBULLET ); if( eState != SfxItemState::SET && eState != SfxItemState::DEFAULT) - throw uno::RuntimeException(); + throw uno::RuntimeException("Invalid item state for paragraph numbering/bullet. Expected SET or DEFAULT."); const SvxNumBulletItem* pBulletItem = rSet.GetItem( EE_PARA_NUMBULLET ); if( pBulletItem == nullptr ) - throw uno::RuntimeException(); + throw uno::RuntimeException("Unable to retrieve paragraph numbering/bullet item."); aAny <<= SvxCreateNumRule( pBulletItem->GetNumRule() ); }