-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Providing more context on spider process errors
Fix #979
- Loading branch information
1 parent
39c98a8
commit 5c102a4
Showing
5 changed files
with
86 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
from minet.exceptions import MinetError | ||
|
||
if TYPE_CHECKING: | ||
from minet.crawl.types import CrawlJob | ||
from minet.web import Response | ||
|
||
|
||
class CrawlerError(MinetError): | ||
pass | ||
|
||
|
||
class CrawlerAlreadyFinishedError(CrawlerError): | ||
pass | ||
|
||
|
||
class CrawlerSpiderProcessError(CrawlerError): | ||
def __init__(self, reason: Exception, job: "CrawlJob", response: "Response"): | ||
self.reason = reason | ||
self.job = job | ||
self.response = response | ||
super().__init__(str(reason)) |