/// <summary> /// Writes a top-level error payload. /// </summary> /// <param name="error">The error instance to write.</param> /// <param name="includeDebugInformation">A flag indicating whether error details should be written (in debug mode only) or not.</param> internal void WriteTopLevelError(ODataError error, bool includeDebugInformation) { Debug.Assert(this.MessageWriterSettings != null, "this.MessageWriterSettings != null"); this.WritePayloadStart(); ODataAtomWriterUtils.WriteError(this.XmlWriter, error, includeDebugInformation, this.MessageWriterSettings.MessageQuotas.MaxNestingDepth); this.WritePayloadEnd(); }
/// <summary> /// Writes an in-stream error. /// </summary> /// <param name="error">The error to write.</param> /// <param name="includeDebugInformation"> /// A flag indicating whether debug information (e.g., the inner error from the <paramref name="error"/>) should /// be included in the payload. This should only be used in debug scenarios. /// </param> private void WriteInStreamErrorImplementation(ODataError error, bool includeDebugInformation) { if (this.outputInStreamErrorListener != null) { this.outputInStreamErrorListener.OnInStreamError(); } ODataAtomWriterUtils.WriteError(this.xmlWriter, error, includeDebugInformation, this.MessageWriterSettings.MessageQuotas.MaxNestingDepth); }