From 3714d1c599308059db351b9867b9350aa533e3e3 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Mon, 17 Feb 2014 18:12:30 +0100 Subject: Do not throw when a singleton can't be raised, only warn. This can happen for mobile platforms where we don't need singletons like com.sun.star.deployment.ExtensionManager. Change-Id: Iad6729539c7ed1ad2b3315c7b9a35647e92ebbff --- cppuhelper/source/component_context.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'cppuhelper/source/component_context.cxx') diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index b6ebb3da079f..be4065d61479 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -600,22 +600,16 @@ Any ComponentContext::lookupMap( OUString const & rName ) } catch (Exception & exc) // rethrow as WrappedTargetRuntimeException { - Any caught( getCaughtException() ); OUStringBuffer buf; buf.append( "exception occurred raising singleton \"" ); buf.append( rName ); buf.append( "\": " ); buf.append( exc.Message ); - throw lang::WrappedTargetRuntimeException( - buf.makeStringAndClear(), static_cast(this),caught ); + SAL_WARN("cppuhelper", buf.makeStringAndClear()); } - if (! xInstance.is()) - { - throw RuntimeException( - "no service object raising singleton " + rName, - static_cast(this) ); - } + SAL_WARN_IF(!xInstance.is(), + "cppuhelper", "no service object raising singleton " << rName); Any ret; guard.reset(); -- cgit v1.2.3