1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Upgrade to ASP.NET Core RC2 release.

This commit is contained in:
Kyle Spearrin
2016-05-19 19:10:24 -04:00
parent d7cb3d47cb
commit 79f507fe68
33 changed files with 289 additions and 231 deletions

View File

@ -2,9 +2,9 @@
using System.IdentityModel.Tokens;
using Bit.Api.Models.Response;
using Bit.Core.Exceptions;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Filters;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@ -48,14 +48,14 @@ namespace Bit.Api.Utilities
}
else
{
var logger = context.HttpContext.ApplicationServices.GetRequiredService<ILogger<ExceptionHandlerFilterAttribute>>();
var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<ExceptionHandlerFilterAttribute>>();
logger.LogError(exception.Message, exception);
errorModel.Message = "An unhandled server error has occured.";
context.HttpContext.Response.StatusCode = 500;
}
var env = context.HttpContext.ApplicationServices.GetRequiredService<IHostingEnvironment>();
var env = context.HttpContext.RequestServices.GetRequiredService<IHostingEnvironment>();
if(env.IsDevelopment())
{
errorModel.ExceptionMessage = exception.Message;

View File

@ -1,5 +1,5 @@
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Filters;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Bit.Api.Models.Response;
using System.Linq;