summaryrefslogtreecommitdiff
path: root/stoc/source/simpleregistry
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2001-09-27 14:38:34 +0000
committerJörg Budischewski <jbu@openoffice.org>2001-09-27 14:38:34 +0000
commit4d39d6a3038c91e7227e85c1875e68b5c0eba058 (patch)
tree3922eb001bf2f7c679eade06d3ae5e824f7fefd2 /stoc/source/simpleregistry
parent677b85023b9102fc856305d0ec3ab4e0b8159a4f (diff)
#91283# improved error handling
Diffstat (limited to 'stoc/source/simpleregistry')
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx30
1 files changed, 27 insertions, 3 deletions
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index ec28c89ca545..f4633ba7edd8 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: simpleregistry.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jsc $ $Date: 2001-08-29 10:00:12 $
+ * last change: $Author: jbu $ $Date: 2001-09-27 15:38:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,9 @@
#ifndef _RTL_ALLOC_H_
#include <rtl/alloc.h>
#endif
+#ifndef _RTL_USTRBUF_H_
+#include <rtl/ustrbuf.hxx>
+#endif
#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
#include <cppuhelper/queryinterface.hxx>
@@ -1104,7 +1107,28 @@ void SAL_CALL SimpleRegistryImpl::open( const OUString& rURL, sal_Bool bReadOnly
}
m_url = OUString();
- throw InvalidRegistryException();
+
+ OUStringBuffer reason( 128 );
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM("Couldn't ") );
+ if( bCreate )
+ {
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM("create") );
+ }
+ else
+ {
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM("open") );
+ }
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM(" registry ") );
+ reason.append( rURL );
+ if( bReadOnly )
+ {
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM("for reading") );
+ }
+ else
+ {
+ reason.appendAscii( RTL_CONSTASCII_STRINGPARAM("for writing" ) );
+ }
+ throw InvalidRegistryException( reason.makeStringAndClear() , Reference< XInterface >() );
}
//*************************************************************************