-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle exceptions thrown in problem constructors (#142)
This aims to tackle an issue uncovered in #140.
- Loading branch information
1 parent
3bdee29
commit a3db61d
Showing
5 changed files
with
122 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace AoCHelper.PoC | ||
{ | ||
public class Day05 : BaseProblem | ||
{ | ||
public Day05() | ||
{ | ||
throw new SolvingException("Exception in constructor"); | ||
} | ||
|
||
public override ValueTask<string> Solve_1() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(66); | ||
return new("Solution 5.2"); | ||
} | ||
} | ||
} |
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,16 @@ | ||
namespace AoCHelper.PoC | ||
{ | ||
public class Day06 : BaseDay | ||
{ | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
throw new SolvingException("Exception in part 1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
Thread.Sleep(123); | ||
return new("Solution 6.2"); | ||
} | ||
} | ||
} |
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,15 @@ | ||
namespace AoCHelper.PoC | ||
{ | ||
public class Day07 : BaseDay | ||
{ | ||
public override ValueTask<string> Solve_1() | ||
{ | ||
return new("Solution 7.1"); | ||
} | ||
|
||
public override ValueTask<string> Solve_2() | ||
{ | ||
throw new SolvingException("Exception in part 2"); | ||
} | ||
} | ||
} |
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