summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 17:32:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-10-01 18:17:11 +0200
commit20bae560c05a3df6e7ce8d4b869ed00f951c1e59 (patch)
tree968607d7c4f33c26302bee6731858c1ed64aa622 /cui
parentebeff35a0305683574373b75c7b0e5797749fe3e (diff)
throw more useful uno::Exception's
if we're going to throw the base class of the exception hierarchy, we can at least put a useful message in there to make the source a little bit easier to locate. Change-Id: I2f3106c99ba25125eacef8fa77e2f3a2c89f2566 Reviewed-on: https://gerrit.libreoffice.org/42968 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optaboutconfig.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index a006e71639ee..85b4a8631487 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -650,7 +650,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
//if the value is 0 and length is not 1, there is something wrong
if( ( nNumb==0 && sNewValue.getLength()!=1 ) || nNumb >= SAL_MAX_INT16 || nNumb <= SAL_MIN_INT16)
- throw uno::Exception();
+ throw uno::Exception("out of range short", nullptr);
nShort = (sal_Int16) nNumb;
pProperty->Value <<= nShort;
}
@@ -658,28 +658,28 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
{
sal_Int32 nLong = sNewValue.toInt32();
if( ( nLong==0 && sNewValue.getLength()!=1 ) || nLong >= SAL_MAX_INT32 || nLong <= SAL_MIN_INT32)
- throw uno::Exception();
+ throw uno::Exception("out of range long", nullptr);
pProperty->Value <<= nLong;
}
else if( sPropertyType == "hyper")
{
sal_Int64 nHyper = sNewValue.toInt64();
if( ( nHyper==0 && sNewValue.getLength()!=1 ) || nHyper >= SAL_MAX_INT32 || nHyper <= SAL_MIN_INT32)
- throw uno::Exception();
+ throw uno::Exception("out of range hyper", nullptr);
pProperty->Value <<= nHyper;
}
else if( sPropertyType == "double")
{
double nDoub = sNewValue.toDouble();
if( ( nDoub ==0 && sNewValue.getLength()!=1 ) || nDoub >= SAL_MAX_INT32 || nDoub <= SAL_MIN_INT32)
- throw uno::Exception();
+ throw uno::Exception("out of range double", nullptr);
pProperty->Value <<= nDoub;
}
else if( sPropertyType == "float")
{
float nFloat = sNewValue.toFloat();
if( ( nFloat ==0 && sNewValue.getLength()!=1 ) || nFloat >= SAL_MAX_INT32 || nFloat <= SAL_MIN_INT32)
- throw uno::Exception();
+ throw uno::Exception("out of range float", nullptr);
pProperty->Value <<= nFloat;
}
else if( sPropertyType == "string" )
@@ -752,7 +752,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
pProperty->Value <<= comphelper::containerToSequence( commaStringToSequence( sNewValue ));
}
else //unknown
- throw uno::Exception();
+ throw uno::Exception("unknown property type " + sPropertyType, nullptr);
sDialogValue = sNewValue;
}