Beispiel #1
0
        private static string FormatErrorMessage(BaseApiResponse apiResponse)
        {
            var reason = string.Empty;

            if (apiResponse != null)
            {
                reason =
                    $"{apiResponse.StatusType} : {apiResponse.StatusMessage} {apiResponse.ErrorsSummary} {apiResponse.Path}";
            }

            return(reason);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the CryptoCompare.Exceptions.CryptoCompareException
 /// class.
 /// </summary>
 /// <param name="apiResponse">Reason of api failure.</param>
 /// <param name="innerException">The inner exception.</param>
 public CryptoCompareException(BaseApiResponse apiResponse, Exception innerException)
     : base(FormatErrorMessage(apiResponse), innerException)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the CryptoCompare.Exceptions.CryptoCompareException
 /// class.
 /// </summary>
 /// <param name="apiResponse">Reason of api failure.</param>
 public CryptoCompareException(BaseApiResponse apiResponse)
     : base(FormatErrorMessage(apiResponse))
 {
 }