コード例 #1
0
ファイル: ErrorReason.cs プロジェクト: Clayster/samples
        public static string GetSerializedValue(this ErrorReason a)
        {
            switch (a)
            {
            case ErrorReason.Forbidden:
                return("forbidden");

            case ErrorReason.Timeout:
                return("timeout");

            case ErrorReason.ResourceDoesNotExist:
                return("resource-does-not-exist");

            case ErrorReason.InvalidData:
                return("invalid-data");

            default:
                throw new Exception("Error reason has invalid value: " + a.ToString());
            }
        }
コード例 #2
0
 /// <summary>
 /// Notification that a call context was closed prematurely, typically due to a timeout
 /// or the session being closed.
 /// </summary>
 /// <remarks>
 /// No further calls will be made for the context.
 /// </remarks>
 public void OnError(ErrorReason errorReason)
 {
     Error = new Exception("This context was closed prematurely. Reason=" + errorReason.ToString());
     resetEvent.Set();
 }
コード例 #3
0
 /// <summary>
 /// Notification that a call context was closed prematurely, typically due to a timeout or
 /// the session being closed.
 /// </summary>
 /// <param name="errorReason">The error reason.</param>
 /// <remarks>
 /// No further calls will be made for the context.
 /// </remarks>
 public void OnError( ErrorReason errorReason )
 {
     Error = new Exception( "This context was closed prematurely. Reason=" + errorReason.ToString() );
     resetEvent.Set();
 }
コード例 #4
0
 public BusinessException(ErrorReason reason, string message = null, Exception innerException = null)
     : base(message ?? reason.ToString(), innerException)
 {
     Reason = reason;
 }
コード例 #5
0
ファイル: WebUtil.cs プロジェクト: hajimen/flowerflower
 public static void AddErrorReasonHeader(HttpContext context, ErrorReason reason)
 {
     context.Response.Headers.Add(SiteConstant.ErrorReasonResposeHeaderName, reason.ToString());
 }