A lot of times, it is mentioned to only catch exceptions which I can handle (throw, wrap and/or log, or perform some other actions).
Which exceptions cannot be handled? Is this the same meaning as should not be caught? I know that exceptions which may represent an object reference being null should not be caught, because they are programming errors and not user-provoked. Is there any other example? Another one is ExecutionEngineException
.
Also, is the course of action in a catch block always just between rethrow, wrap/rethrow and log? Is there ever a case where some other action needs to be performed in a catch block?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…