diff --git a/src/Spring/Spring.Aop/Aop/Framework/Adapter/ThrowsAdviceInterceptor.cs b/src/Spring/Spring.Aop/Aop/Framework/Adapter/ThrowsAdviceInterceptor.cs index b03627d1..42cd1ac4 100644 --- a/src/Spring/Spring.Aop/Aop/Framework/Adapter/ThrowsAdviceInterceptor.cs +++ b/src/Spring/Spring.Aop/Aop/Framework/Adapter/ThrowsAdviceInterceptor.cs @@ -232,7 +232,7 @@ namespace Spring.Aop.Framework.Adapter catch (Exception ex) { LookupAndInvokeAnyHandler(ex, invocation); - throw ex; + throw; } } @@ -310,8 +310,8 @@ namespace Spring.Aop.Framework.Adapter handlerMethod.Invoke(this.throwsAdvice, handlerArgs); } catch (TargetInvocationException ex) - { - throw ex.InnerException; + { + throw ReflectionUtils.UnwrapTargetInvocationException(ex); } } } diff --git a/src/Spring/Spring.Core/Objects/Support/PropertyComparator.cs b/src/Spring/Spring.Core/Objects/Support/PropertyComparator.cs index 880f8b12..cc15bf93 100644 --- a/src/Spring/Spring.Core/Objects/Support/PropertyComparator.cs +++ b/src/Spring/Spring.Core/Objects/Support/PropertyComparator.cs @@ -158,10 +158,10 @@ namespace Spring.Objects.Support { propertyValue = ow.GetPropertyValue(this.sortDefinition.Property); } - catch (InvalidPropertyException ex) + catch (InvalidPropertyException) { // the property doesn't exist in the first place, so let exception through... - throw ex; + throw; } catch (ObjectsException ex) { diff --git a/src/Spring/Spring.Core/Threading/Semaphore.cs b/src/Spring/Spring.Core/Threading/Semaphore.cs index 28a9b381..a178e6b1 100644 --- a/src/Spring/Spring.Core/Threading/Semaphore.cs +++ b/src/Spring/Spring.Core/Threading/Semaphore.cs @@ -87,10 +87,10 @@ namespace Spring.Threading Monitor.Wait(this); --nPermits; } - catch (ThreadInterruptedException ex) + catch (ThreadInterruptedException) { Monitor.Pulse(this); - throw ex; + throw; } } } @@ -134,10 +134,10 @@ namespace Spring.Threading } } } - catch (ThreadInterruptedException ex) + catch (ThreadInterruptedException) { Monitor.Pulse(this); - throw ex; + throw; } } } diff --git a/src/Spring/Spring.Core/Util/EventUtils.cs b/src/Spring/Spring.Core/Util/EventUtils.cs index 538d842f..cfc6e488 100644 --- a/src/Spring/Spring.Core/Util/EventUtils.cs +++ b/src/Spring/Spring.Core/Util/EventUtils.cs @@ -67,8 +67,8 @@ namespace Spring.Util } catch (TargetInvocationException ex) { - // unwrap the exception that actually caused the TargetInvocationException and throw that... - throw ex.GetBaseException(); + // unwrap the exception that actually caused the TargetInvocationException and throw that... + throw ReflectionUtils.UnwrapTargetInvocationException(ex); } } }