You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
473 B
14 lines
473 B
package com.example.datacollect;
|
|
|
|
// 根异常:继承RuntimeException(Unchecked异常),爬虫项目所有异常都继承它
|
|
public class CrawlException extends RuntimeException {
|
|
// 构造器1:只传错误信息
|
|
public CrawlException(String message) {
|
|
super(message);
|
|
}
|
|
|
|
// 构造器2:传错误信息+原始异常(方便排查根因)
|
|
public CrawlException(String message, Throwable cause) {
|
|
super(message, cause);
|
|
}
|
|
}
|