예제 #1
0
        /// <summary>
        /// CreateTableError creates an error response from a table API.
        /// </summary>
        /// <param name="session">The session with which to tamper.</param>
        /// <param name="statusCode">The error code to return</param>
        /// <param name="messageCode">The string name for the error</param>
        /// <param name="message">The long error message to be returned.</param>
        private static void CreateTableError(Session session, int statusCode, string messageCode, string message)
        {
            session.utilCreateResponseAndBypassServer();
            session.oResponse.headers = CreateResponseHeaders(null);
            session.responseCode      = statusCode;

            session.utilSetResponseBody(
                TableConstants.GetError(
                    messageCode,
                    string.Format(
                        "{0}\r\nRequestId:{1}\r\nTime:{2}",
                        message,
                        Guid.Empty.ToString(),
                        DateTime.UtcNow.ToString("o"))).ToString());
        }