Browse Source

Remove redundant try-catch around OnModuleBuilding invocation

If this exception is going to be rethrown, there's no reason to include
a try-catch.
pull/946/head
Christopher F 7 years ago
parent
commit
30066cb102
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      src/Discord.Net.Commands/Builders/ModuleBuilder.cs

+ 2
- 10
src/Discord.Net.Commands/Builders/ModuleBuilder.cs View File

@@ -123,16 +123,8 @@ namespace Discord.Commands.Builders

if (TypeInfo != null)
{
try
{
var moduleInstance = ReflectionUtils.CreateObject<IModuleBase>(TypeInfo, service, services);
moduleInstance.OnModuleBuilding(service, this);
}
catch (Exception)
{
//unsure of what to do here
throw;
}
var moduleInstance = ReflectionUtils.CreateObject<IModuleBase>(TypeInfo, service, services);
moduleInstance.OnModuleBuilding(service, this);
}

return new ModuleInfo(this, service, services, parent);


Loading…
Cancel
Save