-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1378209
commit c5e01f3
Showing
5 changed files
with
37 additions
and
8 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
23 changes: 23 additions & 0 deletions
23
src/Laraue.Crawling.Crawler/CrawlerHasBeenDetectedException.cs
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Laraue.Crawling.Crawler; | ||
|
||
/// <summary> | ||
/// Exception that describe to the system that crawler has been detected and the passed | ||
/// delegate should be executed to continue the crawling process. | ||
/// </summary> | ||
public sealed class CrawlerHasBeenDetectedException : Exception | ||
{ | ||
/// <summary> | ||
/// Delegate to return a crawler to the normal state. | ||
/// </summary> | ||
public Func<Task> SwitchToCorrectStateAsync { get; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="SessionInterruptedException"/> with description of interrupting. | ||
/// </summary> | ||
/// <param name="message"></param> | ||
/// <param name="switchToCorrectStateAsync"></param> | ||
public CrawlerHasBeenDetectedException(string message, Func<Task> switchToCorrectStateAsync) : base(message) | ||
{ | ||
SwitchToCorrectStateAsync = switchToCorrectStateAsync; | ||
} | ||
} |
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