diff options
author | Mohit Marathe <mohitmarathe@proton.me> | 2024-03-24 22:06:46 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2024-04-09 09:06:27 +0200 |
commit | e211607dffe2986601359dcb1ef757fda3805fb3 (patch) | |
tree | 2fd3b8bbc785ecdc1ab9a1eb640e6fc7a2752c6a /editeng | |
parent | 4c1d626d7265b0bfce709e41e62d7c789022ef6d (diff) |
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 <hossein@libreoffice.org>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/uno/unotext.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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() ); } |