/// <summary> /// Efetua a configuração dos analisadores de Exceptions. /// </summary> /// <typeparam name="TException">Tipo da Exception.</typeparam> /// <param name="analyser">Analisador da Exception.</param> public static void SetUp <TException>(ExceptionAnalyserBase <TException> analyser) where TException : Exception { var type = typeof(TException); AddExceptionAnalyser(type, analyser); }
/// <summary> /// Inclui um analisador de Exception /// </summary> /// <typeparam name="TException">Tipo da Exception.</typeparam> /// <param name="exceptionAnalyser">Analisador de Exception.</param> protected void AddExceptionAnalyser <TException>(ExceptionAnalyserBase <TException> exceptionAnalyser) where TException : Exception { var type = typeof(TException); if (_analysers.ContainsKey(type)) { var analyser = _analysers[type]; analyser.Decorate(exceptionAnalyser); } else { _analysers.Add(type, exceptionAnalyser); } }