コード例 #1
0
 /// <summary>
 /// Creates a new instance of an LtsaException class, initializes it with the specified arguments.
 /// </summary>
 /// <param name="exception"></param>
 /// <param name="client"></param>
 /// <param name="error"></param>
 public LtsaException(HttpClientRequestException exception, IHttpRequestClient client, Error error)
     : base($"{exception.Message}{Environment.NewLine}", exception, exception.StatusCode.Value)
 {
     if (exception?.Response?.Content != null)
     {
         if (error?.ErrorMessages?.Count > 0)
         {
             this.Detail = String.Join(Environment.NewLine, error.ErrorMessages.Select(e => $"\t{e}"));
         }
     }
     else
     {
         this.Client = client;
     }
 }
コード例 #2
0
ファイル: ChesException.cs プロジェクト: ychung-mot/PIMS
 /// <summary>
 /// Creates a new instance of an ChesException class, initializes it with the specified arguments.
 /// </summary>
 /// <param name="exception"></param>
 /// <param name="client"></param>
 /// <param name="model"></param>
 public ChesException(HttpClientRequestException exception, IHttpRequestClient client, ErrorResponseModel model)
     : this($"{exception.Message}{Environment.NewLine}", exception, exception.StatusCode)
 {
     this.Client = client;
     this.Detail = $"{model.Title}{Environment.NewLine}{model.Detail}{Environment.NewLine}{model.Type}{Environment.NewLine}{String.Join(Environment.NewLine, model.Errors.Select(e => $"\t{e.Message}"))}";
 }