예제 #1
0
 internal static DateTime?ParseExpiresHeader(string rawValue, string requestId)
 {
     if (!string.IsNullOrEmpty(rawValue))
     {
         try
         {
             return(S3Transforms.ToDateTime(rawValue));
         }
         catch (FormatException e)
         {
             throw new AmazonDateTimeUnmarshallingException(
                       requestId,
                       string.Empty,
                       string.Empty,
                       rawValue,
                       message: string.Format(
                           CultureInfo.InvariantCulture,
                           "The value {0} cannot be converted to a DateTime instance.",
                           rawValue),
                       innerException: e);
         }
     }
     else
     {
         return(default(DateTime));
     }
 }
예제 #2
0
 internal static DateTime?ParseExpiresHeader(string rawValue, string requestId)
 {
     //IL_003d: Unknown result type (might be due to invalid IL or missing references)
     if (!string.IsNullOrEmpty(rawValue))
     {
         try
         {
             return(S3Transforms.ToDateTime(rawValue));
         }
         catch (FormatException ex)
         {
             throw new AmazonDateTimeUnmarshallingException(requestId, string.Empty, string.Empty, rawValue, string.Format(CultureInfo.InvariantCulture, "The value {0} cannot be converted to a DateTime instance.", rawValue), (Exception)ex);
         }
     }
     return(default(DateTime));
 }