From 2e1a109738310a6954f07edf6d2690d8c232efe3 Mon Sep 17 00:00:00 2001 From: "siggi@chromium.org" Date: Wed, 17 Nov 2010 18:54:22 +0000 Subject: Move log statements out of functions that contain __try/__except clauses, because logging instantiates objects, and under some compiler settings the two cannot coexist in the same function. BUG=none TEST=it compiles Review URL: http://codereview.chromium.org/5104003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66480 0039d316-1c4b-4281-b951-d872f2087c98 --- ceee/ie/broker/broker_rpc_client.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ceee') diff --git a/ceee/ie/broker/broker_rpc_client.cc b/ceee/ie/broker/broker_rpc_client.cc index 38506d6..ab6b70e 100644 --- a/ceee/ie/broker/broker_rpc_client.cc +++ b/ceee/ie/broker/broker_rpc_client.cc @@ -35,11 +35,15 @@ int HandleRpcException(unsigned int rpc_exception_code) { return EXCEPTION_EXECUTE_HANDLER; } +static void LogRpcException(const char* str, unsigned int exception_code) { + LOG(ERROR) << str << com::LogWe(exception_code); +} + void BrokerRpcClient::LockContext() { RpcTryExcept { context_ = BrokerRpcClient_Connect(binding_handle_); } RpcExcept(HandleRpcException(RpcExceptionCode())) { - LOG(ERROR) << "RPC error in LockContext: " << RpcExceptionCode(); + LogRpcException("RPC error in LockContext", RpcExceptionCode()); } RpcEndExcept } @@ -47,7 +51,7 @@ void BrokerRpcClient::ReleaseContext() { RpcTryExcept { BrokerRpcClient_Disconnect(binding_handle_, &context_); } RpcExcept(HandleRpcException(RpcExceptionCode())) { - LOG(ERROR) << "RPC error in ReleaseContext: " << RpcExceptionCode(); + LogRpcException("RPC error in ReleaseContext", RpcExceptionCode()); } RpcEndExcept } @@ -110,7 +114,7 @@ bool BrokerRpcClient::FireEvent(BSTR event_name, BSTR event_args) { BrokerRpcClient_FireEvent(binding_handle_, event_name, event_args); return true; } RpcExcept(HandleRpcException(RpcExceptionCode())) { - LOG(ERROR) << "RPC error in FireEvent: " << RpcExceptionCode(); + LogRpcException("RPC error in FireEvent", RpcExceptionCode()); } RpcEndExcept return false; } -- cgit v1.1