Beispiel #1
0
        public bool TryGetDetail(out InvokeFaultDetail detail)
        {
            detail = null;
            var messageFault = this.UnknownFault.CreateMessageFault();

            if (!messageFault.HasDetail)
            {
                return(false);
            }
            detail = messageFault.GetDetail <InvokeFaultDetail>();
            return(true);
        }
Beispiel #2
0
        public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
        {
            var invokeFault = new InvokeFaultDetail()
            {
                FaultLevel = InvokeFaultLevel.SystemUnusual,
                Exception  = new ExceptionDetail(error)
            };
            var ex = error as InvalidInvokeException;

            if (ex != null)
            {
                invokeFault.FaultLevel = ex.FaultLevel;
            }
            var faultException = new FaultException <InvokeFaultDetail>(invokeFault, error.Message);
            var messageFault   = faultException.CreateMessageFault();

            fault = Message.CreateMessage(version, messageFault, faultException.Action);
        }