Exception Handling Helper This is some code that I found in a project I work on. Please tell me that I am crazy and that this code is good. Please do.

public class ExceptionHandlingHelper
{
    static IExeptionHandlerProvider _exeptionHandlerProvider = null;
    static IExeptionHandlerProvider ExeptionHandlerProvider
    {
        get
        {
            if (_exeptionHandlerProvider == null)
            {
                Assembly clientLib = Assembly.Load("Bla.BlaDiBla");
                Type type = clientLib.GetType("Bla.BlaDiBla.Controls.ExeptionHandlerProvider");
                _exeptionHandlerProvider = (IExeptionHandlerProvider)Activator.CreateInstance(type);
            }
            return _exeptionHandlerProvider;
        }
    }

    public static void HandleException(FaultException&lt;DefaultFaultContract&gt; fault)
    {
        var message = new StringBuilder();
        var detail = new StringBuilder();

        ExeptionHandlerProvider.GetMessage(fault, message, detail);

        if (!string.IsNullOrWhiteSpace(fault.Detail.FullStack))
        {
            detail.AppendLine();
            detail.AppendLine(fault.Detail.FullStack);
        }

        if (!string.IsNullOrWhiteSpace(fault.Detail.InnerExceptionStack))
        {
            detail.AppendLine();
            detail.AppendLine("Inner Exception Stack");
            detail.AppendLine(fault.Detail.InnerExceptionMessage);
            detail.AppendLine(fault.Detail.InnerExceptionSource);
            detail.AppendLine(fault.Detail.InnerExceptionStack);
        }

        Handle(message.ToString(), detail.ToString());
    }

    ...
}


Used like this: 

        string serverName = GetServerName();
        using (var factory = new ChannelFactory&lt;T&gt;(GetBinding(TransportType), GetEndPointAddressForClient(typeof(T), TransportType, serverName)))
        {
            var client = GetChannel(factory);
            try
            {
                using (var op = new OperationContextScope(client as IContextChannel))
                {
                    OperationContext.Current.OutgoingMessageHeaders.Add(GetCachedHeader());
                    action(client);
                    ((IClientChannel)client).Close();
                }
            }
            catch (FaultException&lt;DefaultFaultContract&gt; ex)
            {
                ((IClientChannel)client).Abort();
                factory.Abort();
                ExceptionHandlingHelper.HandleException(ex);
            }
            catch (FaultException ex)
            {
                ((IClientChannel)client).Abort();
                factory.Abort();
                ExceptionHandlingHelper.HandleException(ex);
            }
            catch (Exception ex)
            {
                ((IClientChannel)client).Abort();
                factory.Abort();
                ExceptionHandlingHelper.HandleException(ex);
            }
        }
One thing which I noticed is this little spelling error in the code  


static IExeptionHandlerProvider _exeptionHandlerProvider = null;  



Both the name of the interface and the name of the field should be fixed by adding a c -> IExceptionHandlerProvider _exceptionHandlerProvider = null;



public static void HandleException(FaultException&lt;DefaultFaultContract&gt; fault)  

You should initialze the StringBuilder's with a starting capacity, because the default capacity of a StringBuilder is 16 characters, and if it is reached the capacity will be doubled which involves copying the current buffer to the newly created buffer. 

By choosing the initial capacity to be e.g 256 you will maybe waste some memory but you avoid the internal increasing of the buffer.