5 changed files with 77 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||
package com.crawler.exception; |
|||
|
|||
public class CacheException extends CrawlerException { |
|||
|
|||
private String filePath; |
|||
|
|||
public CacheException(String message) { |
|||
super(message); |
|||
} |
|||
|
|||
public CacheException(String message, Throwable cause) { |
|||
super(message, cause); |
|||
} |
|||
|
|||
public CacheException(String message, String filePath) { |
|||
super(message); |
|||
this.filePath = filePath; |
|||
} |
|||
|
|||
public CacheException(String message, String filePath, Throwable cause) { |
|||
super(message, cause); |
|||
this.filePath = filePath; |
|||
} |
|||
|
|||
public String getFilePath() { |
|||
return filePath; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package com.crawler.exception; |
|||
|
|||
public class ConfigurationException extends RuntimeException { |
|||
public ConfigurationException(String message) { |
|||
super(message); |
|||
} |
|||
|
|||
public ConfigurationException(String message, Throwable cause) { |
|||
super(message, cause); |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package com.crawler.exception; |
|||
|
|||
public class CrawlerException extends Exception { |
|||
public CrawlerException(String message) { |
|||
super(message); |
|||
} |
|||
|
|||
public CrawlerException(String message, Throwable cause) { |
|||
super(message, cause); |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.crawler.exception; |
|||
|
|||
public class DataExtractException extends ParseException { |
|||
private String extractField; |
|||
|
|||
public DataExtractException(String message, String extractField) { |
|||
super(message); |
|||
this.extractField = extractField; |
|||
} |
|||
|
|||
public DataExtractException(String message, String extractField, Throwable cause) { |
|||
super(message, cause); |
|||
this.extractField = extractField; |
|||
} |
|||
|
|||
public String getExtractField() { |
|||
return extractField; |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
package com.crawler.exception; |
|||
|
|||
import com.crawler.view.CrawlerView; |
|||
|
|||
public interface ExceptionHandler { |
|||
void handle(Exception e, CrawlerView view); |
|||
Class<? extends Exception> getSupportedExceptionType(); |
|||
} |
|||
Loading…
Reference in new issue