Extension.Exception.cs 408 B

123456789101112131415161718
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Extensions
  7. {
  8. public static partial class Extensions
  9. {
  10. public static Exception GetOriginalException(this Exception ex)
  11. {
  12. if (ex.InnerException == null) return ex;
  13. return ex.InnerException.GetOriginalException();
  14. }
  15. }
  16. }