Add error message if no valid day was found
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f334a7746a
commit
cce05b2179
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user