0

In our application, if required, we are throwing a fault exception as follows:

throw new WebFaultException(new RequestFaultInfo(errorMessage), System.Net.HttpStatusCode.BadRequest);

The RequestFaultInfo class is as follows:

    /// <summary>
    /// Fault information used as the detail of a web service request failure.
    /// </summary>
    [DataContract]
    public class RequestFaultInfo
    {
        #region Constants

        /// <summary>
        /// Summary fault reason.
        /// </summary>
        public const string Reason = "Request failure";

        #endregion

        private string m_errorDescription;

        #region Object Lifetime

        /// <summary>
        /// Constructor specifying the login error description.
        /// </summary>
        /// <param name="errorDescription">Request error description.</param>
        /// <exception cref="ArgumentException">errorDescription is null or empty.</exception>
        public RequestFaultInfo(string errorDescription)
        {
            if (String.IsNullOrEmpty(errorDescription))
            {
                throw new ArgumentException("errorDescription cannot be null or empty", "errorDescription");
            }

            m_errorDescription = errorDescription;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Login error description.
        /// </summary>
        [DataMember]
        public string ErrorDescription 
        { 
            get { return m_errorDescription; }
            private set { m_errorDescription = value; }
        }

        #endregion

However, the client is always getting the status code 202 (Accepted). In this case the client is Postman on the same server.

Has anyone got any ideas why this is happening?

Sputnik
  • 39
  • 4
  • The HyperText Transfer Protocol (HTTP) 202 Accepted response status code indicates that the request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. – Lan Huang Feb 17 '22 at 06:12
  • 202 is non-committal, meaning that there is no way for the HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.https://stackoverflow.com/questions/67635114/http-and-rest-are-status-codes-relevant-to-the-request-or-the-resource – Lan Huang Feb 17 '22 at 06:12

0 Answers0