Why Re-throw Exceptions?

后端 未结 13 1795
借酒劲吻你
借酒劲吻你 2020-12-13 00:25

I\'ve seen the following code many times:

try
{
    ... // some code
}
catch (Exception ex)
{
    ... // Do something
    throw new CustomException(ex);

            


        
13条回答
  •  余生分开走
    2020-12-13 01:01

    FYI, this is a related question about each type of re-throw: Performance Considerations for throwing Exceptions

    My question focuses on "Why" we re-throw exceptions and its usage in application exception handling strategy.

提交回复
热议问题