So I've been struggling to catch database related errors for example if SQL database is down or unavailable, I've get error thrown by the code and website displays a blank page, and if I use app.UseDeveloperExceptionPage();
in Configure method it works fine, but when I am trying to use
either
app.UseStatusCodePagesWithRedirects("/error?error={0}");
or
app.UseExceptionHandler("/error?error={0}");
Nothing happens, just a blank page is displayed, catching other errors such as 404 and so on works just fine. What is a proper way catch all general errors in .NET Core MVC project?