diff --git a/AdventOfCode/Controllers/AdventOfCodeController.cs b/AdventOfCode/Controllers/AdventOfCodeController.cs index ac018ec..ce74de0 100644 --- a/AdventOfCode/Controllers/AdventOfCodeController.cs +++ b/AdventOfCode/Controllers/AdventOfCodeController.cs @@ -25,7 +25,12 @@ namespace AdventOfCode.Controllers { _logger.LogInformation($"Recieving a request for {year} day {day} version {version} with {(IgnoreLogMessages ? "no" : "")}logs"); AOCRequest request = new AOCRequest() { Input = input, Version = version, IgnoreLogMessages = IgnoreLogMessages }; - var resp = GetAOCDay(year, day).ExecuteDay(request); + var aocDay = GetAOCDay(year, day); + if (aocDay == null) + { + return new AOCResponse() { Status = false, StackTrace = $"Year {2023} Day {day} part {version} is not available at this time!" }; + } + var resp = aocDay.ExecuteDay(request); return resp; } diff --git a/AdventOfCode/Startup.cs b/AdventOfCode/Startup.cs index aea08db..e1a011c 100644 --- a/AdventOfCode/Startup.cs +++ b/AdventOfCode/Startup.cs @@ -39,7 +39,7 @@ namespace AdventOfCode services.AddControllers(); services.AddSwaggerGen(c => { - c.SwaggerDoc("v1", new OpenApiInfo { Title = "AdventofCode", Version = "v1.0.0" }); + c.SwaggerDoc("v1", new OpenApiInfo { Title = "AdventofCode", Version = "v1.0.1" }); }); services.AddControllers(o => o.InputFormatters.Insert(o.InputFormatters.Count, new TextPlainInputFormatter())); services.AddSwaggerGenNewtonsoftSupport();