/// <summary> /// Handles the error, occured during the input message handling. /// try to send an error message to remote side /// </summary> ///<exception cref="InvalidOperationException">Critical implementation exception</exception> public void HandleRequestProcessingError(ErrorMessage errorInfo, bool isFatal) { if (!_channel.IsConnected) { return; } try { _sender.SendError(errorInfo); if (isFatal) { _channel.DisconnectBecauseOf(errorInfo); } } catch (LocalSerializationException e) { throw new InvalidOperationException("Error-serializer exception", e); } catch (ConnectionIsNotEstablishedYet) { throw new InvalidOperationException("Channel implementation error. Chanel " + _channel.GetType().Name + " throws ConnectionIsNotEstablishedYet when it was connected"); } catch (ConnectionIsLostException) { _channel.Disconnect(); } }