Namespace: DeltaEngine.Extensions
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Extensions.ExceptionExtensionsTests
2 unit tests call DeltaEngine.Extensions.ExceptionExtensions.IsFatal(System.Exception)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- anyException
- Type: System Exception
Return Value
Type: BooleanUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Exception. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
Examples
[Test] public void CheckForFatalException() { Assert.IsFalse(new Exception().IsFatal()); Assert.IsTrue(new Exception("", new InvalidOperationException()).IsFatal()); Assert.IsTrue(new InvalidOperationException().IsFatal()); Assert.IsTrue(new OutOfMemoryException().IsFatal()); Assert.IsTrue(new AccessViolationException().IsFatal()); Assert.IsTrue(new StackOverflowException().IsFatal()); Assert.IsTrue(new TargetInvocationException(null).IsFatal()); Assert.IsFalse(new NullReferenceException(null).IsFatal()); }
[Test] public void MakeSureFatalExceptionsAreRethrown() { try { TryMakeSureFatalExceptionsAreRethrown(); } // ncrunch: no coverage catch (Exception ex) { Assert.IsTrue(ex.IsFatal()); } }
See Also