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.
26 lines
634 B
26 lines
634 B
package exception;
|
|
|
|
public class NetworkException extends SpiderException {
|
|
public enum ErrorType {
|
|
CONNECTION_TIMEOUT,
|
|
CONNECTION_REFUSED,
|
|
HOST_NOT_FOUND,
|
|
RESPONSE_ERROR
|
|
}
|
|
|
|
private final ErrorType errorType;
|
|
|
|
public NetworkException(String message, ErrorType errorType) {
|
|
super(message);
|
|
this.errorType = errorType;
|
|
}
|
|
|
|
public NetworkException(String message, ErrorType errorType, Throwable cause) {
|
|
super(message, cause);
|
|
this.errorType = errorType;
|
|
}
|
|
|
|
public ErrorType getErrorType() {
|
|
return errorType;
|
|
}
|
|
}
|
|
|