Пример #1
0
 /// <summary>
 /// Writes an <see cref="ODataError"/> into the message payload.
 /// </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>
 /// <returns>Task which represents the pending write operation.</returns>
 /// <remarks>
 /// This method is called if the ODataMessageWriter.WriteError is called once some other
 /// write operation has already started.
 /// The method should write the in-stream error representation for the specific format into the current payload.
 /// Before the method is called no flush is performed on the output context or any active writer.
 /// It is the responsibility of this method to make sure that all the data up to this point are written before
 /// the in-stream error is written.
 /// It is the responsibility of this method to flush the output before the task finishes.
 /// </remarks>
 internal virtual Task WriteInStreamErrorAsync(ODataError error, bool includeDebugInformation)
 {
     throw this.CreatePayloadKindNotSupportedException(ODataPayloadKind.Error);
 }
Пример #2
0
 /// <summary>
 /// Asynchronously writes an <see cref="ODataError"/> as the message payload.
 /// </summary>
 /// <param name="odataError">The error to write.</param>
 /// <param name="includeDebugInformation">
 /// A flag indicating whether debug information (e.g., the inner error from the <paramref name="odataError"/>) should
 /// be included in the payload. This should only be used in debug scenarios.
 /// </param>
 /// <returns>A task representing the asynchronous operation of writing the error.</returns>
 /// <remarks>It is the responsibility of this method to flush the output before the task finishes.</remarks>
 public virtual Task WriteErrorAsync(ODataError odataError, bool includeDebugInformation)
 {
     throw this.CreatePayloadKindNotSupportedException(ODataPayloadKind.Error);
 }
Пример #3
0
 /// <summary>
 /// Writes an <see cref="ODataError"/> as the message payload.
 /// </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>
 /// <remarks>It is the responsibility of this method to flush the output before the method returns.</remarks>
 public virtual void WriteError(ODataError error, bool includeDebugInformation)
 {
     throw this.CreatePayloadKindNotSupportedException(ODataPayloadKind.Error);
 }
Пример #4
0
 /// <summary>Creates a new instance of the <see cref="T:Microsoft.OData.ODataErrorException" /> class with an error message, an inner exception, and an <see cref="T:Microsoft.OData.ODataError" /> object.</summary>
 /// <param name="message">The plain text error message for this exception.</param>
 /// <param name="innerException">The inner exception that is the cause of this exception to be thrown.</param>
 /// <param name="error">The <see cref="T:Microsoft.OData.ODataError" /> instance representing the error read from the payload.</param>
 public ODataErrorException(string message, Exception innerException, ODataError error)
     : base(message, innerException)
 {
     this.state.ODataError = error;
 }
Пример #5
0
 /// <summary>Creates a new instance of the <see cref="T:Microsoft.OData.ODataErrorException" /> class with an error message and an <see cref="T:Microsoft.OData.ODataError" /> object.</summary>
 /// <param name="message">The plain text error message for this exception.</param>
 /// <param name="error">The <see cref="T:Microsoft.OData.ODataError" /> instance representing the error read from the payload.</param>
 public ODataErrorException(string message, ODataError error)
     : this(message, null, error)
 {
 }
Пример #6
0
 /// <summary>Creates a new instance of the <see cref="T:Microsoft.OData.ODataErrorException" /> class with an <see cref="T:Microsoft.OData.ODataError" /> object.</summary>
 /// <param name="error">The <see cref="T:Microsoft.OData.ODataError" /> instance representing the error read from the payload.</param>
 /// <remarks>
 /// The Message property is initialized to a system-supplied message
 /// that describes the error. This message takes into account the
 /// current system culture.
 /// </remarks>
 public ODataErrorException(ODataError error)
     : this(Strings.ODataErrorException_GeneralError, null, error)
 {
 }