コード例 #1
0
ファイル: ExceptionHelper.cs プロジェクト: kenlefeb/SpecFlow
 public static Exception PreserveStackTrace(this Exception ex, string stepName = null)
 {
     // Silverlight can't do the private reflection required to preserve the
     // stack trace, and since we have to store and rethrow this exception,
     // we have no choice but to wrap it, but make sure we don't wrap it more
     // than once
     if (!(ex is ScenarioErrorException))
         ex = new ScenarioErrorException(stepName, ex);
     return ex;
 }
コード例 #2
0
 public static Exception PreserveStackTrace(this Exception ex, string stepName = null)
 {
     // Silverlight can't do the private reflection required to preserve the
     // stack trace, and since we have to store and rethrow this exception,
     // we have no choice but to wrap it, but make sure we don't wrap it more
     // than once
     if (!(ex is ScenarioErrorException))
     {
         ex = new ScenarioErrorException(stepName, ex);
     }
     return(ex);
 }