public Nack(XidMessage inReplyTo, int error, String message, params Object[] args) : base(inReplyTo) { if (message == null) throw new ArgumentNullException("Message cannot be null"); this.error = (NackError)error; this.message = message; this.args = args; }
private static String TextForErrorCode(NackError error) { switch (error) { case NackError.ParseError: return "Syntax error"; case NackError.ExpisTrivial: return "Trivial expression"; default: return "Syntax error (" + error + ")"; } }
public override void Decode(Stream inStream) { base.Decode(inStream); error = (NackError)BinReader.ReadInt32(inStream); message = XdrCoding.getString(inStream); args = XdrCoding.getObjects(inStream); }
/** * Return the error text for a given NACK error code. */ public static String ErrorTextFor(NackError error) { switch (error) { case NackError.ProtIncompat: return "Incompatible protocol"; case NackError.ProtError: return "Communication protocol error"; case NackError.NoSuchSub: return "Unknown subscription ID"; case NackError.ImplLimit: return "Exceeded client connection resource limit"; case NackError.NotImpl: return "Feature not implemented"; case NackError.ParseError: return "Subscription parse error"; case NackError.ExpisTrivial: return "Expression is trivial (constant)"; default: return "Error code " + error; } }