Add analyzer and frontend lint guardrails
This commit is contained in:
@@ -12,6 +12,11 @@ public static class PlayerIdentityExtensions
|
||||
public const string PlayerCookieName = "player";
|
||||
public const string AdminClaim = "is_admin";
|
||||
public const string AdminPolicy = "AdminOnly";
|
||||
private static readonly Action<ILogger, Exception?> LogUnhandledException =
|
||||
LoggerMessage.Define(
|
||||
LogLevel.Error,
|
||||
new EventId(1001, nameof(LogUnhandledException)),
|
||||
"Unhandled exception");
|
||||
|
||||
public static async Task SignInPlayerAsync(HttpContext ctx, Player player)
|
||||
{
|
||||
@@ -40,7 +45,7 @@ public static class PlayerIdentityExtensions
|
||||
var logger = context.RequestServices.GetRequiredService<ILoggerFactory>().CreateLogger("GlobalException");
|
||||
if (feature?.Error != null)
|
||||
{
|
||||
logger.LogError(feature.Error, "Unhandled exception");
|
||||
LogUnhandledException(logger, feature.Error);
|
||||
}
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
|
||||
Reference in New Issue
Block a user