Skip to content

Commit cac4fe3

Browse files
committed
small error handling
1 parent be30b9e commit cac4fe3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

AdventOfCode/Solutions/ASolution.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ string LoadInput() {
121121
{
122122
DateTime CURRENT_EST = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Utc).AddHours(-5);
123123
if (CURRENT_EST < new DateTime(Year, 12, Day)) throw new InvalidOperationException();
124-
124+
125125
input = Program.Http.GetStringAsync(INPUT_URL).Result.Trim();
126126
File.WriteAllText(INPUT_FILEPATH, input);
127127
File.WriteAllText(DEBUGINPUT_FILEPATH, string.Empty);
@@ -144,6 +144,9 @@ string LoadInput() {
144144
catch( InvalidOperationException ) {
145145
Console.WriteLine($"Day {Day}: Cannot fetch puzzle input before given date (Eastern Standard Time).");
146146
}
147+
catch(ArgumentException e) {
148+
Console.WriteLine(e.Message);
149+
}
147150
catch
148151
{
149152
throw;

0 commit comments

Comments
 (0)