Should I include all exceptions in a more significant exception? The Wrapping value makes the exception an internal exception of the new exception and throws a "new" exception.
What factors do I need to consider when doing this?
Is the idea of ββwrapping exceptions because:
SQL Server can throw a bunch of exceptions from the T-SQL level. My C # API will only handle SQLException (the descriptor value has a catch block), so I want to wrap the exceptions in a type that my API can handle. This is just an example, SQL Server throws only a SQLException, but is this correct?
I assume that throwing a βnewβ exception, as mentioned above, will have a reason that is not the real reason (which the developer should know), so it would be more friendly to the end user and hide sensitive implementation information about the real / first exception.
thanks
exception exception-handling
dotnetdev
source share