예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
                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;
                     }
                   }
                }
예제 #4
0
        /// <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;
       }
예제 #5
0
파일: Exceptions.cs 프로젝트: itadapter/nfx
 public RemoteException(string message, RemoteExceptionData data, Exception inner)
     : base(message, inner)
 {
     m_Remote = data;
 }
예제 #6
0
파일: Exceptions.cs 프로젝트: itadapter/nfx
 public RemoteException(string message, RemoteExceptionData data)
     : base(message)
 {
     m_Remote = data;
 }
예제 #7
0
파일: Exceptions.cs 프로젝트: itadapter/nfx
 public RemoteException(RemoteExceptionData data)
     : base(data.ToString())
 {
     m_Remote = data;
 }