From 30066cb102ffbd65906ead72a377811aa501abba Mon Sep 17 00:00:00 2001 From: Christopher F Date: Sat, 27 Jan 2018 16:37:22 -0500 Subject: [PATCH] Remove redundant try-catch around OnModuleBuilding invocation If this exception is going to be rethrown, there's no reason to include a try-catch. --- src/Discord.Net.Commands/Builders/ModuleBuilder.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Discord.Net.Commands/Builders/ModuleBuilder.cs b/src/Discord.Net.Commands/Builders/ModuleBuilder.cs index 0189ceaca..1809c2c63 100644 --- a/src/Discord.Net.Commands/Builders/ModuleBuilder.cs +++ b/src/Discord.Net.Commands/Builders/ModuleBuilder.cs @@ -123,16 +123,8 @@ namespace Discord.Commands.Builders if (TypeInfo != null) { - try - { - var moduleInstance = ReflectionUtils.CreateObject(TypeInfo, service, services); - moduleInstance.OnModuleBuilding(service, this); - } - catch (Exception) - { - //unsure of what to do here - throw; - } + var moduleInstance = ReflectionUtils.CreateObject(TypeInfo, service, services); + moduleInstance.OnModuleBuilding(service, this); } return new ModuleInfo(this, service, services, parent);