public void RejectMessage(AmqpMessage message, Exception exception) { Rejected rejected = new Rejected(); rejected.Error = AmqpError.FromException(exception); this.DisposeMessage(message, rejected, true, false); }
private void SendOpen() { base.TransitState("S:OPEN", StateTransition.SendOpen); if (base.TerminalException != null) { base.Settings.AddProperty("com.microsoft:open-error", AmqpError.FromException(base.TerminalException, true)); } this.SendCommand(base.Settings, 0, null); }
private void SendClose() { base.TransitState("S:CLOSE", StateTransition.SendClose); Close close = new Close(); if (base.TerminalException != null) { close.Error = AmqpError.FromException(base.TerminalException, true); } this.SendCommand(close, 0, null); }
public static AmqpException FromError(Microsoft.ServiceBus.Messaging.Amqp.Framing.Error error) { if (error == null || error.Condition.Value == null) { return(null); } if (error.Description != null) { return(new AmqpException(error, error.Description)); } return(new AmqpException(AmqpError.GetError(error.Condition))); }
void SendClose() { this.TransitState("S:CLOSE", StateTransition.SendClose); Close close = new Close(); if (this.TerminalException != null) { close.Error = AmqpError.FromException(this.TerminalException); } this.SendCommand(close, 0); }
protected AmqpObjectState SendEnd() { StateTransition stateTransition = base.TransitState("S:END", StateTransition.SendClose); End end = new End(); Exception terminalException = base.TerminalException; if (terminalException != null) { end.Error = AmqpError.FromException(terminalException, true); } this.SendCommand(end); return(stateTransition.To); }
protected void SendEnd() { this.TransitState("S:END", StateTransition.SendClose); End end = new End(); Exception exception = this.TerminalException; if (exception != null) { end.Error = AmqpError.FromException(exception); } this.SendCommand(end); }
private AmqpObjectState SendDetach() { StateTransition stateTransition = base.TransitState("S:DETACH", StateTransition.SendClose); Detach detach = new Detach() { Handle = this.LocalHandle, Closed = new bool?(true) }; Exception terminalException = base.TerminalException; if (terminalException != null) { detach.Error = AmqpError.FromException(terminalException, true); } this.Session.SendCommand(detach); return(stateTransition.To); }
public static AmqpException FromError(Error error) { if (error == null || error.Condition.Value == null) { return(null); } if (error.Description == null) { Error amqpError = AmqpError.GetError(error.Condition); return(new AmqpException(amqpError)); } else { return(new AmqpException(error, error.Description)); } }
void SendDetach() { this.TransitState("S:DETACH", StateTransition.SendClose); Detach detach = new Detach(); detach.Handle = this.LocalHandle; detach.Closed = true; Exception exception = this.TerminalException; if (exception != null) { detach.Error = AmqpError.FromException(exception); } this.Session.SendCommand(detach); }