summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorJörg Barfurth <jb@openoffice.org>2000-12-11 10:06:37 +0000
committerJörg Barfurth <jb@openoffice.org>2000-12-11 10:06:37 +0000
commitc3fb32efe982f973955533bf7e09349e2297da00 (patch)
treee4c5c56e8d771ab10ec176ecf4bbd518305c187b /configmgr
parent07c4e12b6f47ab40b2fab569a341f9d6b16412cb (diff)
#80882# Catch and Translate configuration::Exception in createXxxAccess (did violate exception specification)
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/api2/confproviderimpl2.cxx53
1 files changed, 37 insertions, 16 deletions
diff --git a/configmgr/source/api2/confproviderimpl2.cxx b/configmgr/source/api2/confproviderimpl2.cxx
index cf712fa3f8af..f7b29915d5da 100644
--- a/configmgr/source/api2/confproviderimpl2.cxx
+++ b/configmgr/source/api2/confproviderimpl2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confproviderimpl2.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: dg $ $Date: 2000-12-04 19:34:55 $
+ * last change: $Author: jb $ $Date: 2000-12-11 11:06:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,7 @@
#include "noderef.hxx"
#include "apitreeaccess.hxx"
#include "objectregistry.hxx"
+#include "configexcept.hxx"
#ifndef CONFIGMGR_API_PROVIDER2_HXX_
#include "confprovider2.hxx"
@@ -125,17 +126,27 @@ namespace configmgr
// create the access object
uno::Reference< uno::XInterface > xReturn;
- if (aArgs.getLength() != 0)
+ try
{
- NodeElement* pElement = buildReadAccess(sPath, xOptions, nLevels);
- if (pElement != 0)
+ if (aArgs.getLength() != 0)
{
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
+ NodeElement* pElement = buildReadAccess(sPath, xOptions, nLevels);
+ if (pElement != 0)
+ {
+ xReturn = pElement->getUnoInstance();
+ if (xReturn.is())
+ // acquired once by buildReadAccess
+ xReturn->release();
+ }
}
}
+ catch (configuration::Exception& e)
+ {
+ configapi::ExceptionMapper ec(e);
+ ec.setContext(this->getProviderInstance());
+ //ec.unhandled();
+ throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
+ }
return xReturn;
}
@@ -159,17 +170,27 @@ namespace configmgr
// create the access object
uno::Reference< uno::XInterface > xReturn;
- if (aArgs.getLength() != 0)
+ try
{
- NodeElement* pElement = buildUpdateAccess(sPath, xOptions, nLevels);
- if (pElement != 0)
+ if (aArgs.getLength() != 0)
{
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
+ NodeElement* pElement = buildUpdateAccess(sPath, xOptions, nLevels);
+ if (pElement != 0)
+ {
+ xReturn = pElement->getUnoInstance();
+ if (xReturn.is())
+ // acquired once by buildReadAccess
+ xReturn->release();
+ }
}
}
+ catch (configuration::Exception& e)
+ {
+ configapi::ExceptionMapper ec(e);
+ ec.setContext(this->getProviderInstance());
+ //ec.unhandled();
+ throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
+ }
return xReturn;
}
} // namespace configmgr