Custom exception and exception handling

Usually, Java developers need custom exception handler to unknown problems that may arise, divided into two categories, Error and Exception under Throwable.

1. We need custom exception, inherited from RuntimeException

2. When abnormal crawling, we particle size small to large, precise exception -> Exception to this order

3. abnormal crawling, needs to be done in a catch at treatment, or throw, or record problems, not just to play log (no one will see, when until the problem)

4. exception handling, please Baidu own unified exception handling

Guess you like

Origin www.cnblogs.com/ixan/p/11204294.html