Map response of rate limit quota into exception
sarahhachouche1 opened this issue · comments
I want to map response of rate limit quota into exception,
`app.UseSwaggerForOcelotUI(opt =>
{
var serverOcelot = Configuration["ServerOcelot"]; // Could be replaced by a non existing functionality dotnet/aspnetcore#5898
opt.PathToSwaggerGenerator = "/swagger/docs";
opt.DownstreamSwaggerEndPointBasePath = $"{serverOcelot}/swagger/docs";
opt.ReConfigureUpstreamSwaggerJson = AlterUpsteamSwaggeerJson;
opt.ServerOcelot = $"{serverOcelot}";
})
.UseOcelot()
.Wait();
app.Use(async (context, next) =>
{
await next(context);
if (context.Response.StatusCode == 429)
{
throw new RateLimitException("Rate limit exceed");
}
});`
but its not even reaching my startup.cs any insight how to do so