﻿<?xml version="1.0" encoding="utf-8"?><Type Name="DoNotSwallowErrorsCatchingNonSpecificExceptionsRule" FullName="Gendarme.Rules.Exceptions.DoNotSwallowErrorsCatchingNonSpecificExceptionsRule"><TypeSignature Language="C#" Value="public class DoNotSwallowErrorsCatchingNonSpecificExceptionsRule : Gendarme.Framework.Rule, Gendarme.Framework.IMethodRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DoNotSwallowErrorsCatchingNonSpecificExceptionsRule extends Gendarme.Framework.Rule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Exceptions</AssemblyName><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Framework.Rule</BaseTypeName></Base><Interfaces><Interface><InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName></Interface></Interfaces><Attributes><Attribute><AttributeName>Gendarme.Framework.EngineDependency(typeof(Gendarme.Framework.Engines.OpCodeEngine))</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("This method catches a very general exception without rethrowing it. This is not safe to do in general and may mask problems that the caller should be made aware of.")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("Rethrow the original exception (which will preserve the stacktrace of the original error) or catch a more specific exception type.")</AttributeName></Attribute></Attributes><Docs><summary>
            This rule will fire if a catch block catches <c>System.Exception</c> or
            <c>System.SystemException</c> but does not rethrow the original
            exception. This is problematic because you don't know what went wrong
            so it's difficult to know that the error was handled correctly. It is better
            to catch a more specific set of exceptions so that you do know what went
            wrong and do know that it is handled correctly.
            </summary><remarks>Prior to Gendarme 2.0 this rule was named DontSwallowErrorsCatchingNonspecificExceptionsRule.</remarks><example>
            Bad example:
            <code>
            try {
            	File.Open ("foo.txt", FileMode.Open);
            }
            catch (Exception) {
            	//Ooops  what's failed ??? UnauthorizedException, FileNotFoundException ???
            }
            </code></example><example>
            Good example (catch a specific exception):
            <code>
            try {
            	File.Open ("foo.txt", FileMode.Open);
            }
            catch (FileNotFoundException exception) {
            	//I know that the system can't find the file.
            }
            </code></example><example>
            Good example (catch all and rethrow):
            <code>
            try {
            	File.Open ("foo.txt", FileMode.Open);
            }
            catch {
            	Console.WriteLine ("An error has happened.");
            	throw;  // You don't swallow the error, because you rethrow the original exception.
            }
            </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public DoNotSwallowErrorsCatchingNonSpecificExceptionsRule ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="CheckMethod"><MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckMethod (Mono.Cecil.MethodDefinition method);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckMethod(class Mono.Cecil.MethodDefinition method) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>Gendarme.Framework.RuleResult</ReturnType></ReturnValue><Parameters><Parameter Name="method" Type="Mono.Cecil.MethodDefinition" /></Parameters><Docs><param name="method">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member></Members></Type>