0

Whenever I throw an exception in my service, another exception is thrown right after it:

System.ServiceModel.CommunicationException: There was an error reading from the
pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an
error reading from the pipe: Unrecognized error 109 (0x6d).

I'm implementing IErrorHandler so I can log (using log4net) all unhandled exceptions:

    bool IErrorHandler.HandleError(Exception error)
    {
        if (!(error is FaultException))
        {
            logger.Fatal("Unhandled Exception", error);
        }
        return false;
    }

Any idea why is that?

Meidan Alon
  • 3,074
  • 7
  • 45
  • 63
  • I'd double check if the problem really lies in the handler. I did quite exactly the same thing. The IErrorHandler is a valid approach in general I would say. – Alex Dec 06 '09 at 23:23

1 Answers1

1

Problem was client calling Abort on the channel whenever I returned a fault exception.

Meidan Alon
  • 3,074
  • 7
  • 45
  • 63
  • What was the change you did to fix this? Remove the call to Abort? Replace it with something else (Close)? – Roy Sep 17 '10 at 08:37
  • Indeed, client has to call Close (or its equivalent, depending on platform) – Meidan Alon Oct 10 '10 at 15:48
  • @MeidanAlon: How did that work? You can't call Close on a channel that is in a faulted state as it throws a different exception - "The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state." – Divi Jun 15 '15 at 22:29