##// END OF EJS Templates
Добавлена метка v3.0.16 для набора изменений 00a2d52813ee
Добавлена метка v3.0.16 для набора изменений 00a2d52813ee

File last commit:

r289:95896f882995 v3.0.14 v3
r298:a7c3390f6ac8 default
Show More
ExceptionHelpers.cs
20 lines | 700 B | text/x-csharp | CSharpLexer
/ Implab / src / ExceptionHelpers.cs
cin
Added tests for Implab.ServiceHost.Unity configuration loader.
r289 using System;
using System.Reflection;
using System.Runtime.ExceptionServices;
namespace Implab {
static class ExceptionHelpers {
public static Exception Rethrow(this Exception that) {
ExceptionDispatchInfo.Capture(that).Throw();
return new TargetInvocationException(that);
}
public static Exception Wrap(this Exception that) {
if (that == null)
return new Exception();
else if (that is OperationCanceledException)
return new OperationCanceledException("The operation has been cancelled", that);
else
return new TargetInvocationException(that);
}
}
}