feat: Re-raise base exception from ReflectionUtils.CreateInstance, TargetInvocationException and TypeLoadException don't say much

This commit is contained in:
Chris Cameron
2018-07-03 14:55:04 -04:00
parent 268e201f49
commit 21a583a57c
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### Changed
- Re-raise base exception from ReflectionUtils.CreateInstance, TargetInvocationException and TypeLoadException don't say much
## [3.7.0] - 2018-07-02 ## [3.7.0] - 2018-07-02
### Added ### Added

View File

@@ -253,7 +253,11 @@ namespace ICD.Common.Utils
} }
catch (TypeLoadException e) catch (TypeLoadException e)
{ {
throw new TypeLoadException(e.GetBaseException().Message); throw e.GetBaseException();
}
catch (TargetInvocationException e)
{
throw e.GetBaseException();
} }
string message = string.Format("Unable to find constructor for {0}", type.Name); string message = string.Format("Unable to find constructor for {0}", type.Name);