Can I not catch a specific or custom exception?

后端 未结 6 1648
余生分开走
余生分开走 2021-01-18 02:16

I dont want to catch some exception. Can I do it somehow?

Can I say something like this:

catch (Exception e BUT not CustomExceptionA)
{
}
         


        
6条回答
  •  無奈伤痛
    2021-01-18 03:12

    try
    {
          // Explosive code
    }
    catch (CustomExceptionA){ throw; }
    catch (Exception ex)
    {
        //classic error handling
    }
    

提交回复
热议问题