示例#1
0
        /// <summary>
        /// calls send exception interception point;
        /// Don't throw exception,if an interception point throws an exception.
        /// Instead, pass the exception on to the next interception point with send_excpetion.
        /// </summary>
        internal Exception SendException(ServerRequestInfoImpl serverInfo, Exception sentException)
        {
            Exception result = sentException;

            if (serverInfo != null)   // can be null, if no interception chain available -> don't set in this case
            // update exception in requestInfo
            {
                serverInfo.SetSentException(sentException);
            }
            while (ProceedToNextInterceptor())   // proceed either to the begin element in reply chain, or skip failing element
            {
                ServerRequestInterceptor current = GetCurrentInterceptor();
                try {
                    current.send_exception(serverInfo);
                } catch (Exception ex) {
                    result = ex;
                    // update exception in requestInfo
                    serverInfo.SetSentException(ex);
                }
            }
            return(result);
        }