e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
//-----------------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//-----------------------------------------------------------------------------
|
|
using System;
|
|
using System.ServiceModel.Channels;
|
|
using System.Runtime;
|
|
|
|
namespace System.ServiceModel.Dispatcher
|
|
{
|
|
class WebFaultFormatter : IDispatchFaultFormatter, IDispatchFaultFormatterWrapper
|
|
{
|
|
IDispatchFaultFormatter faultFormatter;
|
|
|
|
internal WebFaultFormatter(IDispatchFaultFormatter faultFormatter)
|
|
{
|
|
this.faultFormatter = faultFormatter;
|
|
}
|
|
|
|
public MessageFault Serialize(FaultException faultException, out string action)
|
|
{
|
|
try
|
|
{
|
|
return this.faultFormatter.Serialize(faultException, out action);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
if (Fx.IsFatal(e))
|
|
{
|
|
throw;
|
|
}
|
|
action = null;
|
|
return MessageFault.Default;
|
|
}
|
|
}
|
|
|
|
public IDispatchFaultFormatter InnerFaultFormatter
|
|
{
|
|
get
|
|
{
|
|
return this.faultFormatter;
|
|
}
|
|
set
|
|
{
|
|
this.faultFormatter = value;
|
|
}
|
|
}
|
|
}
|
|
}
|