/// <summary> /// Initializes instance form local exception /// </summary> public RemoteExceptionData(Exception error) { var tp = error.GetType(); m_TypeName = tp.FullName; m_Message = error.Message; if (error is NFXException) m_Code = ((NFXException)error).Code; m_ApplicationName = ExecutionContext.Application.Name; m_Source = error.Source; m_StackTrace = error.StackTrace; if (error.InnerException!=null) m_InnerException = new RemoteExceptionData(error.InnerException); }
/// <summary> /// Initializes instance form local exception /// </summary> public RemoteExceptionData(Exception error) { var tp = error.GetType(); m_TypeName = tp.FullName; m_Message = error.Message; if (error is NFXException) { m_Code = ((NFXException)error).Code; } m_ApplicationName = ExecutionContext.Application.Name; m_Source = error.Source; m_StackTrace = error.StackTrace; if (error.InnerException != null) { m_InnerException = new RemoteExceptionData(error.InnerException); } }
private ResponseMsg handleRequest(RequestMsg request) { try { ServerCallContext.__SetThreadLevelContext(request); try { var response = doWork(request); var rhdr = ServerCallContext.GetResponseHeadersOrNull(); if (rhdr!=null && response!=null) response.Headers = rhdr; return response; } finally { ServerCallContext.__ResetThreadLevelContext(); } } catch(Exception error) { if (request.OneWay) { //because it is one-way, the caller will never know about it this.WriteLog(LogSrc.Server, MessageType.Error, string.Format(StringConsts.GLUE_SERVER_ONE_WAY_CALL_ERROR + error.ToMessageWithType()), from: "SrvrHndlr.handleRequest(ReqMsg)", exception: error ); return null; } else { var red = new RemoteExceptionData(error); var response = new ResponseMsg(request.RequestID, red); response.__SetBindingSpecificContext(request); return response; } } }
/// <summary> /// Handles request synchronously in the context of the calling thread. Returns NULL for one-way calls /// </summary> public ResponseMsg HandleRequestFailure(FID reqID, bool oneWay, Exception failure, object bindingSpecCtx) { if (oneWay) return null; var red = new RemoteExceptionData(failure); var response = new ResponseMsg(reqID, red); response.__SetBindingSpecificContext(bindingSpecCtx); return response; }
public RemoteException(string message, RemoteExceptionData data, Exception inner) : base(message, inner) { m_Remote = data; }
public RemoteException(string message, RemoteExceptionData data) : base(message) { m_Remote = data; }
public RemoteException(RemoteExceptionData data) : base(data.ToString()) { m_Remote = data; }