This commit is contained in:
34
server/ControllerHelpers/ApiNotAuthorizedResponse.cs
Normal file
34
server/ControllerHelpers/ApiNotAuthorizedResponse.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Sockeye.Biz;
|
||||
|
||||
namespace Sockeye.Api.ControllerHelpers
|
||||
{
|
||||
|
||||
|
||||
|
||||
public class ApiNotAuthorizedResponse
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
private ILogger log = Sockeye.Util.ApplicationLogging.CreateLogger<ApiNotAuthorizedResponse>();
|
||||
|
||||
//Mandatory properties
|
||||
public ApiError Error { get; }
|
||||
|
||||
//Generic error
|
||||
public ApiNotAuthorizedResponse()
|
||||
{
|
||||
Error = new ApiError(ApiErrorCode.NOT_AUTHORIZED, ApiErrorCodeStockMessage.GetTranslationCodeForApiErrorCode(ApiErrorCode.NOT_AUTHORIZED));
|
||||
|
||||
log.LogDebug("ApiErrorCode={0}, message={1}", (int)ApiErrorCode.NOT_AUTHORIZED, Error.Message);
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
}//eons
|
||||
Reference in New Issue
Block a user