diff -r 2a9601315dfc -r 98ccebc37403 javacommons/utils/functionserver/src/methodcall.cpp --- a/javacommons/utils/functionserver/src/methodcall.cpp Mon May 03 12:27:20 2010 +0300 +++ b/javacommons/utils/functionserver/src/methodcall.cpp Fri May 14 15:47:24 2010 +0300 @@ -34,7 +34,16 @@ OS_EXPORT void MethodCaller::ExecuteLeavingFunctorL(const Functor& functor, java::util::FunctionServer* functionServer, int* /*res*/) { JELOG2(EUtils); - int error = functionServer->executeInServerThread(functor); + int error = KErrNone; + try + { + error = functionServer->executeInServerThread(functor); + } + catch (std::exception&) + { + error = KErrServerTerminated; + } + if (error) // Do not use LeaveIfError(), we want to handle positive error codes as well { User::Leave(error);