We would like to remove redundant try catch blocks in our application.
Obviously an unity interceptor can implement a common handler and save lots of duplicate code.
But i havent found a way to suppress the exception in the intercepted method.
Current:
void InterceptedMethod
{
try
{
}
catch()
{
}
}
Intended:
void InterceptedMethod
{
//no try catch blocks
}
for example (using StreamReader sr= new StreamReader(some invalid path)) will throw an exception in the intercepted method, that will not be caught if i remove the existing try catch block.
The code after (result.Exception ! = null) is executing successfully.
But it currently serves only "before enter" and "after exit" scenarios.
I still need to remove the try catch blocks in the intercepted method. I know postsharp or castle windsor allows us to set properties.
what is the way with unity IOC?