Esempio n. 1
0
 /// <summary>
 /// Throw a relevant exception if <paramref name="result"/> is a failure.
 /// </summary>
 /// <param name="path">Optional path or other input detail.</param>
 public static void ThrowIfFailed(this HResult result, string?path = null)
 {
     if (result.Failed())
     {
         result.Throw(path);
     }
 }
Esempio n. 2
0
 /// <summary>
 ///  Throw a relevant exception if <paramref name="result"/> is a failure.
 /// </summary>
 /// <param name="detail">Optional path or other input detail.</param>
 public static void ThrowIfFailed(this HResult result, string?detail = null)
 {
     if (result.Failed())
     {
         result.Throw(detail);
     }
 }