diff -r f9bb0fca356a -r 0fd27995241b javacommons/utils/functionserver/src/methodcall.cpp --- a/javacommons/utils/functionserver/src/methodcall.cpp Fri Apr 30 10:40:48 2010 +0300 +++ b/javacommons/utils/functionserver/src/methodcall.cpp Tue May 11 16:07:20 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);