diff --git a/project/exception/HtmlParseException.java b/project/exception/HtmlParseException.java new file mode 100644 index 0000000..98fe11a --- /dev/null +++ b/project/exception/HtmlParseException.java @@ -0,0 +1,19 @@ +package com.crawler.exception; + +public class HtmlParseException extends ParseException { + private String sourceUrl; + + public HtmlParseException(String message, String sourceUrl) { + super(message); + this.sourceUrl = sourceUrl; + } + + public HtmlParseException(String message, String sourceUrl, Throwable cause) { + super(message, cause); + this.sourceUrl = sourceUrl; + } + + public String getSourceUrl() { + return sourceUrl; + } +} \ No newline at end of file diff --git a/project/exception/HttpRequestException.java b/project/exception/HttpRequestException.java new file mode 100644 index 0000000..a4c302e --- /dev/null +++ b/project/exception/HttpRequestException.java @@ -0,0 +1,19 @@ +package com.crawler.exception; + +public class HttpRequestException extends NetworkException { + private int statusCode; + + public HttpRequestException(String message, int statusCode) { + super(message); + this.statusCode = statusCode; + } + + public HttpRequestException(String message, int statusCode, Throwable cause) { + super(message, cause); + this.statusCode = statusCode; + } + + public int getStatusCode() { + return statusCode; + } +} \ No newline at end of file diff --git a/project/exception/InvalidUrlException.java b/project/exception/InvalidUrlException.java new file mode 100644 index 0000000..0846cf5 --- /dev/null +++ b/project/exception/InvalidUrlException.java @@ -0,0 +1,14 @@ +package com.crawler.exception; + +public class InvalidUrlException extends ConfigurationException { + private String invalidUrl; + + public InvalidUrlException(String message, String invalidUrl) { + super(message); + this.invalidUrl = invalidUrl; + } + + public String getInvalidUrl() { + return invalidUrl; + } +} \ No newline at end of file diff --git a/project/exception/NetworkException.java b/project/exception/NetworkException.java new file mode 100644 index 0000000..e4ddfef --- /dev/null +++ b/project/exception/NetworkException.java @@ -0,0 +1,11 @@ +package com.crawler.exception; + +public class NetworkException extends CrawlerException { + public NetworkException(String message) { + super(message); + } + + public NetworkException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file diff --git a/project/exception/ParseException.java b/project/exception/ParseException.java new file mode 100644 index 0000000..410baa0 --- /dev/null +++ b/project/exception/ParseException.java @@ -0,0 +1,11 @@ +package com.crawler.exception; + +public class ParseException extends CrawlerException { + public ParseException(String message) { + super(message); + } + + public ParseException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file